Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -30,10 +30,10 @@ def speech_to_speech_translation(audio,voice_preset="v2/zh_speaker_1"):
|
|
30 |
translated_text = translate(audio)
|
31 |
synthesised_speech = synthesise(translated_text,voice_preset)
|
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"
|
39 |
description = """
|
@@ -61,10 +61,10 @@ Muti_translate=gr.Interface(
|
|
61 |
],
|
62 |
outputs=[
|
63 |
gr.Audio(label="Generated Speech", type="numpy"),
|
|
|
64 |
],
|
65 |
title=title,
|
66 |
description=description,
|
67 |
-
article=article,
|
68 |
examples=examples,
|
69 |
)
|
70 |
|
|
|
30 |
translated_text = translate(audio)
|
31 |
synthesised_speech = synthesise(translated_text,voice_preset)
|
32 |
synthesised_speech = (synthesised_speech.numpy() * 32767).astype(np.int16)
|
33 |
+
return synthesised_rate , synthesised_speech , translated_text
|
34 |
def speech_to_speech_translation_fix(audio,voice_preset="v2/zh_speaker_1"):
|
35 |
+
synthesised_rate,synthesised_speech ,translated_text= speech_to_speech_translation(audio,voice_preset)
|
36 |
+
return synthesised_rate,synthesised_speech.T,translated_text
|
37 |
|
38 |
title = "Multilanguage to Chinese(mandarin) Cascaded STST"
|
39 |
description = """
|
|
|
61 |
],
|
62 |
outputs=[
|
63 |
gr.Audio(label="Generated Speech", type="numpy"),
|
64 |
+
gr.Text(label="Transcription"),
|
65 |
],
|
66 |
title=title,
|
67 |
description=description,
|
|
|
68 |
examples=examples,
|
69 |
)
|
70 |
|