Spaces:
Runtime error
Runtime error
ashhadahsan
commited on
Commit
•
149aab0
1
Parent(s):
4ec0c0b
Update app.py
Browse files
app.py
CHANGED
@@ -165,8 +165,15 @@ with output:
|
|
165 |
temp = AudioSegment.from_wav(audio_uploaded)
|
166 |
temp.export(f"{name}.wav")
|
167 |
if audio_uploaded.name.endswith(".mp3"):
|
168 |
-
|
169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
if language == "":
|
171 |
model = whisper.load_model(model_name)
|
172 |
with st.spinner("Detecting language..."):
|
|
|
165 |
temp = AudioSegment.from_wav(audio_uploaded)
|
166 |
temp.export(f"{name}.wav")
|
167 |
if audio_uploaded.name.endswith(".mp3"):
|
168 |
+
try:
|
169 |
+
|
170 |
+
temp = AudioSegment.from_file(audio_uploaded, format="mp3")
|
171 |
+
temp.export(f"{name}.wav")
|
172 |
+
except:
|
173 |
+
|
174 |
+
|
175 |
+
temp = AudioSegment.from_file(audio_uploaded, format="mp4")
|
176 |
+
temp.export(f"{name}.wav")
|
177 |
if language == "":
|
178 |
model = whisper.load_model(model_name)
|
179 |
with st.spinner("Detecting language..."):
|