Skip to content

Commit

Permalink
[feat] Print error (Fix flake8 F841)
Browse files Browse the repository at this point in the history
  • Loading branch information
ftnext committed Mar 31, 2024
1 parent 1768998 commit b5de44b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/microphone_recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@
except sr.UnknownValueError:
print("Whisper could not understand audio")
except sr.RequestError as e:
print("Could not request results from Whisper")
print(f"Could not request results from Whisper; {e}")

# recognize speech using Whisper API
OPENAI_API_KEY = "INSERT OPENAI API KEY HERE"
try:
print(f"Whisper API thinks you said {r.recognize_whisper_api(audio, api_key=OPENAI_API_KEY)}")
except sr.RequestError as e:
print("Could not request results from Whisper API")
print(f"Could not request results from Whisper API; {e}")

0 comments on commit b5de44b

Please sign in to comment.