Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
|
|
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())
|