Closed iEnki closed 1 year ago
yeah...having same problem on MacOs
Same to me, try both on win and mac
same error here.
Solved solution go to this repo https://github.com/VikasSharma707/chatgpt-api-whisper-api-voice-assistant
Hi guys, this worked for me:
from pydub import AudioSegment
audio_file_wav = open(audio, "rb")
audio_file_mp3 = AudioSegment.from_wav(audio_file_wav).export("audio.mp3", format="mp3")
transcript = openai.Audio.transcribe("whisper-1", audio_file_mp3)
I'm using pydub
to convert the audio file to wav, this export the mp3 file that can be send to the Whisper API without a problem
Hi guys, this worked for me:
from pydub import AudioSegment audio_file_wav = open(audio, "rb") audio_file_mp3 = AudioSegment.from_wav(audio_file_wav).export("audio.mp3", format="mp3") transcript = openai.Audio.transcribe("whisper-1", audio_file_mp3)
I'm using
pydub
to convert the audio file to wav, this export the mp3 file that can be send to the Whisper API without a problem
Thanks, it resolved the issue.
Was having this problem as well. I found this solution, similar concept to the one above. We are just adding an audio file extension.
https://github.com/gradio-app/gradio/issues/3479
def transcribe(audio):
os.rename(audio, audio + '.wav')
file = open(audio + '.wav', "rb")
return openai.Audio.transcribe("whisper-1", file).text
Thanks for the rename suggestion, added this to repo :). I'm guessing the API didn't initially validate the extension, but they added this after I recorded.
Hey all,
i can´t fix this Problem. ffmpeg installed finde, the audi file is saved as .wav but still this error stops my transcription. Any Ideas for this fix. Iam on windows system, maybe there are codec error?
Error: openai.error.InvalidRequestError: Invalid file format. Supported formats: ['m4a', 'mp3', 'webm', 'mp4', 'mpga', 'wav', 'mpeg']