Vihang28 commited on
Commit
06770cf
·
verified ·
1 Parent(s): 6457b6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -32,6 +32,8 @@ def change_aud(text: str, speaker_wav, speaker_wav_file):
32
  tts.tts_to_file(text, speaker_wav=speaker_wav, language="en", file_path=file_path)
33
  else:
34
  tts.tts_to_file(text, speaker=tts.speakers[0], language="en", file_path=file_path)
 
 
35
  return file_path
36
 
37
  def show_error(text):
@@ -40,8 +42,6 @@ def show_error(text):
40
  else:
41
  return gr.update(visible=False), gr.update(visible=True)
42
 
43
- def download_file(aud_file):
44
- return aud_file
45
 
46
  title = "Voice-Cloning-Demo"
47
 
@@ -80,7 +80,7 @@ with gr.Blocks(css="footer {visibility: hidden}") as demo:
80
  download_button = gr.DownloadButton(label="Download Audio", value=None, visible=True)
81
  error_box = gr.Textbox(label="WARNING", value="Input box cannot be blank!!", visible=False, container=True)
82
 
83
- download_button.click(download_file, audio_output, download_button)
84
  btn_clear.add(audio_output)
85
  btn.click(text_to_speech, inputs=[text_input, audio_input_mic, audio_input_file], outputs=audio_output)
86
  btn.click(show_error, text_input, [error_box, audio_output])
 
32
  tts.tts_to_file(text, speaker_wav=speaker_wav, language="en", file_path=file_path)
33
  else:
34
  tts.tts_to_file(text, speaker=tts.speakers[0], language="en", file_path=file_path)
35
+ def download_file():
36
+ return file_path
37
  return file_path
38
 
39
  def show_error(text):
 
42
  else:
43
  return gr.update(visible=False), gr.update(visible=True)
44
 
 
 
45
 
46
  title = "Voice-Cloning-Demo"
47
 
 
80
  download_button = gr.DownloadButton(label="Download Audio", value=None, visible=True)
81
  error_box = gr.Textbox(label="WARNING", value="Input box cannot be blank!!", visible=False, container=True)
82
 
83
+ download_button.click(download_file, outputs=download_button)
84
  btn_clear.add(audio_output)
85
  btn.click(text_to_speech, inputs=[text_input, audio_input_mic, audio_input_file], outputs=audio_output)
86
  btn.click(show_error, text_input, [error_box, audio_output])