Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] Add tests for recognize_whisper_api #776

Closed
amjadnattouf opened this issue Oct 29, 2024 · 2 comments
Closed

[test] Add tests for recognize_whisper_api #776

amjadnattouf opened this issue Oct 29, 2024 · 2 comments
Assignees

Comments

@amjadnattouf
Copy link

Steps to reproduce

  1. To reproduce this issue, add the test cases to the speech_recognition module specifically for error handling in the recognize_whisper_api function.
  2. Run the tests with cases for missing API key, invalid audio data, and missing openai module. Code examples of each scenario are included above.
  3. If necessary, also include an audio file that simulates invalid or unexpected audio data.

Expected behaviour

I expected the recognize_whisper_api function to:

  • Raise a SetupError when the API key is missing.
  • Raise a ValueError when invalid audio data is provided.
  • Raise a SetupError with a specific error message when the openai module is not found.

Actual behaviour

Instead of the expected behavior, the function did not handle one or more of these exceptions correctly (e.g., it failed to detect the missing API key, invalid audio data, or missing openai module). Please refer to the specific test cases for details.

(If any exceptions are thrown during testing, paste the full stack trace here for each case.)

System information

My system is MacOS.
My Python version is 3.12.3.
My Pip version is 24.2.
My SpeechRecognition library version is 3.8.1.
My PyAudio library version is not installed.
My microphones are: ['Microphone 1', 'Microphone 2'].
My working microphones are: ['Microphone 1'].

I installed PocketSphinx from Homebrew.

@amjadnattouf
Copy link
Author

@ftnext could you please check this when you have time?

@ftnext
Copy link
Collaborator

ftnext commented Jan 1, 2025

#782 (comment)

@ftnext ftnext closed this as not planned Won't fix, can't repro, duplicate, stale Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants