Skip to content

Commit

Permalink
fix: stt node error
Browse files Browse the repository at this point in the history
  • Loading branch information
wxg0103 committed Feb 5, 2025
1 parent 8be91b1 commit 1a4c1b2
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ def speech_to_text(self, audio_file):
result = recognition.call(temp_file_path)
text = ''
if result.status_code == 200:
for sentence in result.get_sentence():
text += sentence['text']
return text
result_sentence = result.get_sentence()
if result_sentence is not None:
for sentence in result_sentence:
text += sentence['text']
return text
else:
raise Exception('Error: ', result.message)
finally:
Expand Down

0 comments on commit 1a4c1b2

Please sign in to comment.