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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -32,8 +32,6 @@ 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
- def download_file():
36
- return file_path
37
  return file_path
38
 
39
  def show_error(text):
@@ -43,6 +41,10 @@ def show_error(text):
43
  return gr.update(visible=False), gr.update(visible=True)
44
 
45
 
 
 
 
 
46
  title = "Voice-Cloning-Demo"
47
 
48
  def toggle(choice):
@@ -77,10 +79,10 @@ with gr.Blocks(css="footer {visibility: hidden}") as demo:
77
  btn = gr.Button("Generate", variant="primary")
78
  with gr.Column():
79
  audio_output = gr.Audio(label="Output", visible=True, autoplay=True, show_share_button=False)
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])
 
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):
 
41
  return gr.update(visible=False), gr.update(visible=True)
42
 
43
 
44
+ # def download_file():
45
+ # return file_path
46
+
47
+
48
  title = "Voice-Cloning-Demo"
49
 
50
  def toggle(choice):
 
79
  btn = gr.Button("Generate", variant="primary")
80
  with gr.Column():
81
  audio_output = gr.Audio(label="Output", visible=True, autoplay=True, show_share_button=False)
82
+ # download_button = gr.DownloadButton(label="Download Audio", value=None, visible=True)
83
  error_box = gr.Textbox(label="WARNING", value="Input box cannot be blank!!", visible=False, container=True)
84
 
85
+ # download_button.click(download_file, outputs=download_button)
86
  btn_clear.add(audio_output)
87
  btn.click(text_to_speech, inputs=[text_input, audio_input_mic, audio_input_file], outputs=audio_output)
88
  btn.click(show_error, text_input, [error_box, audio_output])