Commit
·
4652db7
1
Parent(s):
b9a1e7a
Update app.py
Browse files
app.py
CHANGED
@@ -29,8 +29,8 @@ def speech_to_speech_translation(audio):
|
|
29 |
translated_text = translate(audio)
|
30 |
synthesised_speech = synthesise(translated_text)
|
31 |
synthesised_speech = (synthesised_speech.numpy() * 32767).astype(np.int16)
|
32 |
-
return translated_text
|
33 |
-
|
34 |
|
35 |
|
36 |
title = "Cascaded STST"
|
@@ -46,7 +46,6 @@ mic_translate = gr.Interface(
|
|
46 |
fn=speech_to_speech_translation,
|
47 |
inputs=gr.Audio(source="microphone", type="filepath"),
|
48 |
outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
49 |
-
#examples=[["./example.wav"]],
|
50 |
title=title,
|
51 |
description=description,
|
52 |
)
|
@@ -55,7 +54,7 @@ file_translate = gr.Interface(
|
|
55 |
fn=speech_to_speech_translation,
|
56 |
inputs=gr.Audio(source="upload", type="filepath"),
|
57 |
outputs=gr.outputs.Textbox(),
|
58 |
-
|
59 |
#examples=[["./example.wav"]],
|
60 |
title=title,
|
61 |
description=description,
|
|
|
29 |
translated_text = translate(audio)
|
30 |
synthesised_speech = synthesise(translated_text)
|
31 |
synthesised_speech = (synthesised_speech.numpy() * 32767).astype(np.int16)
|
32 |
+
#return translated_text
|
33 |
+
return 16000, synthesised_speech
|
34 |
|
35 |
|
36 |
title = "Cascaded STST"
|
|
|
46 |
fn=speech_to_speech_translation,
|
47 |
inputs=gr.Audio(source="microphone", type="filepath"),
|
48 |
outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
|
|
49 |
title=title,
|
50 |
description=description,
|
51 |
)
|
|
|
54 |
fn=speech_to_speech_translation,
|
55 |
inputs=gr.Audio(source="upload", type="filepath"),
|
56 |
outputs=gr.outputs.Textbox(),
|
57 |
+
outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
58 |
#examples=[["./example.wav"]],
|
59 |
title=title,
|
60 |
description=description,
|