Skip to content

Commit

Permalink
[docs] recognize_whisper_api SetupError
Browse files Browse the repository at this point in the history
  • Loading branch information
ftnext committed Mar 10, 2023
1 parent be90eb2 commit 58f9eed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions reference/library-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ This function requires an OpenAI account; visit https://platform.openai.com/sign

Detail: https://platform.openai.com/docs/guides/speech-to-text

Raises a ``speech_recognition.exceptions.SetupError`` exception if there are any issues with the openai installation, or the environment variable is missing.

``AudioSource``
---------------

Expand Down
2 changes: 2 additions & 0 deletions speech_recognition/recognizers/whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def recognize_whisper_api(
This function requires an OpenAI account; visit https://platform.openai.com/signup, then generate API Key in `User settings <https://platform.openai.com/account/api-keys>`__.
Detail: https://platform.openai.com/docs/guides/speech-to-text
Raises a ``speech_recognition.exceptions.SetupError`` exception if there are any issues with the openai installation, or the environment variable is missing.
"""
if not isinstance(audio_data, AudioData):
raise ValueError("``audio_data`` must be an ``AudioData`` instance")
Expand Down

0 comments on commit 58f9eed

Please sign in to comment.