ashhadahsan commited on
Commit
149aab0
1 Parent(s): 4ec0c0b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
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
- temp = AudioSegment.from_file(audio_uploaded, format="mp4")
169
- temp.export(f"{name}.wav")
 
 
 
 
 
 
 
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..."):