Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,10 @@ import speech_recognition as sr
|
|
4 |
def transcribe_audio(audio_file):
|
5 |
recognizer = sr.Recognizer()
|
6 |
|
|
|
|
|
|
|
|
|
7 |
# Ensure the audio_file is a file path
|
8 |
if not isinstance(audio_file, str):
|
9 |
raise ValueError("Expected audio_file to be a file path, got {}".format(type(audio_file)))
|
|
|
4 |
def transcribe_audio(audio_file):
|
5 |
recognizer = sr.Recognizer()
|
6 |
|
7 |
+
# Check if audio_file is a tuple and extract the file path
|
8 |
+
if isinstance(audio_file, tuple):
|
9 |
+
audio_file = audio_file[0]
|
10 |
+
|
11 |
# Ensure the audio_file is a file path
|
12 |
if not isinstance(audio_file, str):
|
13 |
raise ValueError("Expected audio_file to be a file path, got {}".format(type(audio_file)))
|