Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,7 +32,7 @@ def speech_to_speech_translation(audio,voice_preset="v2/zh_speaker_1"):
|
|
| 32 |
synthesised_speech = (synthesised_speech.numpy() * 32767).astype(np.int16)
|
| 33 |
return synthesised_rate , synthesised_speech
|
| 34 |
def speech_to_speech_translation_fix(audio,voice_preset="v2/zh_speaker_1"):
|
| 35 |
-
synthesised_rate,synthesised_speech
|
| 36 |
return synthesised_rate,synthesised_speech.T
|
| 37 |
|
| 38 |
title = "Multilanguage to Chinese(mandarin) Cascaded STST"
|
|
@@ -71,10 +71,7 @@ demo = gr.Blocks()
|
|
| 71 |
mic_translate = gr.Interface(
|
| 72 |
fn=speech_to_speech_translation_fix,
|
| 73 |
inputs=gr.Audio(source="microphone", type="filepath"),
|
| 74 |
-
outputs=
|
| 75 |
-
gr.Audio(label="Generated Speech", type="numpy"),
|
| 76 |
-
|
| 77 |
-
],
|
| 78 |
title=title,
|
| 79 |
description=description,
|
| 80 |
)
|
|
@@ -82,10 +79,7 @@ mic_translate = gr.Interface(
|
|
| 82 |
file_translate = gr.Interface(
|
| 83 |
fn=speech_to_speech_translation_fix,
|
| 84 |
inputs=gr.Audio(source="upload", type="filepath"),
|
| 85 |
-
outputs=
|
| 86 |
-
gr.Audio(label="Generated Speech", type="numpy"),
|
| 87 |
-
|
| 88 |
-
],
|
| 89 |
examples=examples,
|
| 90 |
title=title,
|
| 91 |
description=description,
|
|
|
|
| 32 |
synthesised_speech = (synthesised_speech.numpy() * 32767).astype(np.int16)
|
| 33 |
return synthesised_rate , synthesised_speech
|
| 34 |
def speech_to_speech_translation_fix(audio,voice_preset="v2/zh_speaker_1"):
|
| 35 |
+
synthesised_rate,synthesised_speech = speech_to_speech_translation(audio,voice_preset)
|
| 36 |
return synthesised_rate,synthesised_speech.T
|
| 37 |
|
| 38 |
title = "Multilanguage to Chinese(mandarin) Cascaded STST"
|
|
|
|
| 71 |
mic_translate = gr.Interface(
|
| 72 |
fn=speech_to_speech_translation_fix,
|
| 73 |
inputs=gr.Audio(source="microphone", type="filepath"),
|
| 74 |
+
outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
|
|
|
|
|
|
|
|
|
| 75 |
title=title,
|
| 76 |
description=description,
|
| 77 |
)
|
|
|
|
| 79 |
file_translate = gr.Interface(
|
| 80 |
fn=speech_to_speech_translation_fix,
|
| 81 |
inputs=gr.Audio(source="upload", type="filepath"),
|
| 82 |
+
outputs=gr.Audio(label="Generated Speech", type="numpy"),
|
|
|
|
|
|
|
|
|
|
| 83 |
examples=examples,
|
| 84 |
title=title,
|
| 85 |
description=description,
|