Baghdad99 commited on
Commit
7e87039
1 Parent(s): 306b64d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -50,7 +50,8 @@ def translate_speech(audio):
50
  audio_bytes = response.content
51
 
52
  # Convert the audio bytes to an audio segment
53
- audio_segment = AudioSegment.from_file(io.BytesIO(audio_bytes), format="wav")
 
54
 
55
  # Convert the audio segment to a numpy array
56
  audio_data = np.array(audio_segment.get_array_of_samples())
 
50
  audio_bytes = response.content
51
 
52
  # Convert the audio bytes to an audio segment
53
+ audio_segment = AudioSegment.from_mp3(io.BytesIO(audio_bytes))
54
+
55
 
56
  # Convert the audio segment to a numpy array
57
  audio_data = np.array(audio_segment.get_array_of_samples())