Plachta commited on
Commit
01c8f17
1 Parent(s): 6edba4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -284,16 +284,13 @@ if __name__ == "__main__":
284
  audio_output = gr.Audio(label="Output Audio", elem_id="tts-audio")
285
  btn = gr.Button("Generate!")
286
  cus_dur_gn_btn = gr.Button("Regenerate with custom phoneme durations")
287
- btn.click(infer, inputs=[textbox, char_dropdown, language_dropdown, duration_slider, noise_scale_slider, noise_scale_w_slider, symbol_input],
288
- outputs=[text_output, audio_output, phoneme_output, duration_output])
289
  download = gr.Button("Download Audio")
290
  download.click(None, [], [], _js=download_audio_js.format(audio_id="tts-audio"))
291
  with gr.Accordion(label="Speaking Pace Control", open=True):
292
 
293
  duration_output = gr.Textbox(label="Duration of each phoneme", placeholder="After you generate a sentence, the detailed information of each phoneme's duration will be presented here.",
294
  interactive = True)
295
- cus_dur_gn_btn.click(infer_from_phoneme_dur, inputs=[duration_output, char_dropdown, duration_slider, noise_scale_slider, noise_scale_w_slider],
296
- outputs=[phoneme_output, audio_output])
297
  gr.Markdown(
298
  "\{ \}内的数字代表每个音素在生成的音频中的长度,\{ \}外的数字代表音素之间间隔的长度。"
299
  "您可以手动修改这些数字来控制每个音素以及间隔的长度,从而完全控制合成音频的说话节奏。"
@@ -302,6 +299,10 @@ if __name__ == "__main__":
302
  "You can manually change the numbers to adjust the length of each phoneme, so that speaking pace can be completely controlled."
303
  "Note that these numbers should be integers only. \n\n(1 represents a length of 0.01161 seconds)\n\n"
304
  )
 
 
 
 
305
 
306
  examples = [['haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......', '29:米浴', '日本語', 1, 0.667, 0.8, True],
307
  ['お疲れ様です,トレーナーさん。', '1:无声铃鹿', '日本語', 1, 0.667, 0.8, False],
 
284
  audio_output = gr.Audio(label="Output Audio", elem_id="tts-audio")
285
  btn = gr.Button("Generate!")
286
  cus_dur_gn_btn = gr.Button("Regenerate with custom phoneme durations")
287
+
 
288
  download = gr.Button("Download Audio")
289
  download.click(None, [], [], _js=download_audio_js.format(audio_id="tts-audio"))
290
  with gr.Accordion(label="Speaking Pace Control", open=True):
291
 
292
  duration_output = gr.Textbox(label="Duration of each phoneme", placeholder="After you generate a sentence, the detailed information of each phoneme's duration will be presented here.",
293
  interactive = True)
 
 
294
  gr.Markdown(
295
  "\{ \}内的数字代表每个音素在生成的音频中的长度,\{ \}外的数字代表音素之间间隔的长度。"
296
  "您可以手动修改这些数字来控制每个音素以及间隔的长度,从而完全控制合成音频的说话节奏。"
 
299
  "You can manually change the numbers to adjust the length of each phoneme, so that speaking pace can be completely controlled."
300
  "Note that these numbers should be integers only. \n\n(1 represents a length of 0.01161 seconds)\n\n"
301
  )
302
+ btn.click(infer, inputs=[textbox, char_dropdown, language_dropdown, duration_slider, noise_scale_slider, noise_scale_w_slider, symbol_input],
303
+ outputs=[text_output, audio_output, phoneme_output, duration_output])
304
+ cus_dur_gn_btn.click(infer_from_phoneme_dur, inputs=[duration_output, char_dropdown, duration_slider, noise_scale_slider, noise_scale_w_slider],
305
+ outputs=[phoneme_output, audio_output])
306
 
307
  examples = [['haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......haa\u2193......', '29:米浴', '日本語', 1, 0.667, 0.8, True],
308
  ['お疲れ様です,トレーナーさん。', '1:无声铃鹿', '日本語', 1, 0.667, 0.8, False],