zongxiao commited on
Commit
5973534
·
1 Parent(s): 3907e87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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 , 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 = """
@@ -73,7 +73,7 @@ mic_translate = gr.Interface(
73
  inputs=gr.Audio(source="microphone", type="filepath"),
74
  outputs=[
75
  gr.Audio(label="Generated Speech", type="numpy"),
76
- gr.Text(label="Transcription"),
77
  ],
78
  title=title,
79
  description=description,
@@ -84,7 +84,7 @@ file_translate = gr.Interface(
84
  inputs=gr.Audio(source="upload", type="filepath"),
85
  outputs=[
86
  gr.Audio(label="Generated Speech", type="numpy"),
87
- gr.Text(label="Transcription"),
88
  ],
89
  examples=examples,
90
  title=title,
 
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 ,translated_text= 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 = """
 
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,
 
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,