Spaces:
Build error
Build error
Commit
·
fb0bdd0
1
Parent(s):
53c1f5b
Update app.py
Browse files
app.py
CHANGED
@@ -40,15 +40,14 @@ def translate_speech_to_speech(input_audio):
|
|
40 |
tts.save(output_file)
|
41 |
|
42 |
# Load the translated audio and return as an output
|
43 |
-
translated_audio,
|
44 |
-
translated_audio = (translated_audio * 32767).astype("int16")
|
45 |
|
46 |
return translated_audio
|
47 |
|
48 |
title = "Speech-to-Speech Translator"
|
49 |
|
50 |
-
input_audio = gr.inputs.Audio(source="microphone", type="numpy"
|
51 |
-
output_audio = gr.outputs.Audio(type="numpy"
|
52 |
|
53 |
stt_demo = gr.Interface(
|
54 |
fn=translate_speech_to_speech,
|
|
|
40 |
tts.save(output_file)
|
41 |
|
42 |
# Load the translated audio and return as an output
|
43 |
+
translated_audio, _ = sf.read(output_file, dtype="int16")
|
|
|
44 |
|
45 |
return translated_audio
|
46 |
|
47 |
title = "Speech-to-Speech Translator"
|
48 |
|
49 |
+
input_audio = gr.inputs.Audio(source="microphone", type="numpy")
|
50 |
+
output_audio = gr.outputs.Audio(type="numpy")
|
51 |
|
52 |
stt_demo = gr.Interface(
|
53 |
fn=translate_speech_to_speech,
|