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

recognize_whisper_api automatically translates to Italian #681

Closed
danielenapo opened this issue Apr 12, 2023 · 1 comment · Fixed by #802
Closed

recognize_whisper_api automatically translates to Italian #681

danielenapo opened this issue Apr 12, 2023 · 1 comment · Fixed by #802

Comments

@danielenapo
Copy link

Expected behaviour

When speaking in english, recognize_whisper_api should transcribe text in english

Actual behaviour

When speaking long enough phrases, the api automatically translates to Italian (I'm in Italy), even though I spoke in English.
in the api documentation there is an optional "language" option. It would be nice if language could be selected when calling recognize_whisper_api as an optional argument.

@danielenapo danielenapo changed the title Whisper_API automatically translates to Italian recognize_whisper_api automatically translates to Italian Apr 12, 2023
@ftnext ftnext closed this as completed in bab6e06 Dec 7, 2024
@ftnext
Copy link
Collaborator

ftnext commented Dec 8, 2024

@danielenapo Try SpeechRecognition 3.12.0

python -m pip install 'SpeechRecognition[openai]==3.12.0'

>>> # NOTICE: export OPENAI_API_KEY before launching Python interpreter
>>> import speech_recognition as sr
>>> r = sr.Recognizer()
>>> with sr.AudioFile("english.wav") as source:
...   audio = r.record(source)
>>> r.recognize_openai(audio, language="en")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants