Update app.py
Browse files
app.py
CHANGED
@@ -57,8 +57,8 @@ def transcribe_audio(audio, openai_api_key):
|
|
57 |
|
58 |
openai.api_key = openai_api_key
|
59 |
try:
|
60 |
-
# Transcribe the audio to text
|
61 |
-
audio_file = openai.Audio.
|
62 |
return audio_file['text']
|
63 |
except Exception as e:
|
64 |
return f"Error transcribing audio: {str(e)}"
|
|
|
57 |
|
58 |
openai.api_key = openai_api_key
|
59 |
try:
|
60 |
+
# Transcribe the audio to text using the correct method
|
61 |
+
audio_file = openai.Audio.transcribe(file=audio, model="whisper-1")
|
62 |
return audio_file['text']
|
63 |
except Exception as e:
|
64 |
return f"Error transcribing audio: {str(e)}"
|