Skip to content

Commit

Permalink
fix: handle Google Speech Recognition could not understand audio
Browse files Browse the repository at this point in the history
  • Loading branch information
msadeqsirjani committed Jun 13, 2023
1 parent 19d7a02 commit 853f14c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .idea/BarkTalk.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,17 @@ def ask(language: str):

os.remove(secure_file_path)

if prompt is None:
return jsonify({"data": None,
"message": "Google Speech Recognition could not understand audio",
"status": "success"}), 400

engine = gpt_engine.GptEngine()

answer_text = engine.command(prompt=prompt)

exact_answer_voice_name = text_to_speech.convert(text=answer_text,
language=language)
language=language)

data = {
"prompt": prompt,
Expand Down
Binary file modified requirements.txt
Binary file not shown.

0 comments on commit 853f14c

Please sign in to comment.