Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,12 +14,13 @@ def transcribe_audio(file_path):
|
|
14 |
|
15 |
# Open the wav file
|
16 |
try:
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
23 |
except Exception as e:
|
24 |
return f"Error during transcription: {e}"
|
25 |
|
|
|
14 |
|
15 |
# Open the wav file
|
16 |
try:
|
17 |
+
audio_file = open(file_path, 'rb')
|
18 |
+
response = openai.Audio.transcribe(
|
19 |
+
model="whisper-1", # specify the appropriate model for transcription
|
20 |
+
file=audio_file,
|
21 |
+
language='ta' # specify 'ta' for Tamil language
|
22 |
+
)
|
23 |
+
audio_file.close()
|
24 |
except Exception as e:
|
25 |
return f"Error during transcription: {e}"
|
26 |
|