Update app.py
Browse files
app.py
CHANGED
@@ -57,12 +57,16 @@ def translate_speech(audio_file):
|
|
57 |
print("The synthesised speech does not contain 'audio'")
|
58 |
return
|
59 |
|
|
|
|
|
|
|
60 |
# Scale the audio data to the range of int16 format
|
61 |
synthesised_speech = (synthesised_speech_data * 32767).astype(np.int16)
|
62 |
|
63 |
return 16000, synthesised_speech
|
64 |
|
65 |
|
|
|
66 |
# Define the Gradio interface
|
67 |
iface = gr.Interface(
|
68 |
fn=translate_speech,
|
|
|
57 |
print("The synthesised speech does not contain 'audio'")
|
58 |
return
|
59 |
|
60 |
+
# Flatten the audio data
|
61 |
+
synthesised_speech_data = synthesised_speech_data.flatten()
|
62 |
+
|
63 |
# Scale the audio data to the range of int16 format
|
64 |
synthesised_speech = (synthesised_speech_data * 32767).astype(np.int16)
|
65 |
|
66 |
return 16000, synthesised_speech
|
67 |
|
68 |
|
69 |
+
|
70 |
# Define the Gradio interface
|
71 |
iface = gr.Interface(
|
72 |
fn=translate_speech,
|