broadfield commited on
Commit
3153988
·
verified ·
1 Parent(s): 60680ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -45,7 +45,12 @@ def exp2():
45
  def exp3():
46
  exp_file=f"./example/en_US-ljspeech-high__1__1__0_5__1.json"
47
  return(gr.update(value=txt),gr.update(value=exp_file))
48
-
 
 
 
 
 
49
 
50
  with gr.Blocks(theme="Hev832/Applio-Theme") as b:
51
  gr.HTML("""<h1 style='font-size:xxx-large;font-weight:900;'>Piper Fast TTS</h1>
@@ -55,6 +60,7 @@ with gr.Blocks(theme="Hev832/Applio-Theme") as b:
55
  with gr.Row():
56
  with gr.Column(scale=1):
57
  with gr.Accordion("Control"):
 
58
  length=gr.Slider(label="Length", minimum=0.01, maximum=10.0, value=1)
59
  noise=gr.Slider(label="Noise", minimum=0.01, maximum=3.0, value=1)
60
  width=gr.Slider(label="Noise Width", minimum=0.01, maximum=3.0, value=1)
@@ -78,7 +84,7 @@ with gr.Blocks(theme="Hev832/Applio-Theme") as b:
78
  save_btn.click(save_set,[names,length,noise,width,sen_pause],save_file)
79
  load_file.change(load_set,load_file,[names,length,noise,width,sen_pause])
80
  names.change(load_mod,names,json_ob)
81
- sub_btn.click(pp.stream_tts,[in_txt,names,length,noise,width,sen_pause],out_aud)
82
  b.load(init,None,names)
83
 
84
  b.queue().launch(max_threads=40)
 
45
  def exp3():
46
  exp_file=f"./example/en_US-ljspeech-high__1__1__0_5__1.json"
47
  return(gr.update(value=txt),gr.update(value=exp_file))
48
+ def stream_check(checked,in_txt,names,length,noise,width,sen_pause):
49
+ if checked:
50
+ yield pp.stream_tts(in_txt,names,length,noise,width,sen_pause)
51
+ else:
52
+ return pp.tts(in_txt,names,length,noise,width,sen_pause)
53
+
54
 
55
  with gr.Blocks(theme="Hev832/Applio-Theme") as b:
56
  gr.HTML("""<h1 style='font-size:xxx-large;font-weight:900;'>Piper Fast TTS</h1>
 
60
  with gr.Row():
61
  with gr.Column(scale=1):
62
  with gr.Accordion("Control"):
63
+ stream=gr.Checkbox(value=True)
64
  length=gr.Slider(label="Length", minimum=0.01, maximum=10.0, value=1)
65
  noise=gr.Slider(label="Noise", minimum=0.01, maximum=3.0, value=1)
66
  width=gr.Slider(label="Noise Width", minimum=0.01, maximum=3.0, value=1)
 
84
  save_btn.click(save_set,[names,length,noise,width,sen_pause],save_file)
85
  load_file.change(load_set,load_file,[names,length,noise,width,sen_pause])
86
  names.change(load_mod,names,json_ob)
87
+ sub_btn.click(stream_check,[in_txt,names,length,noise,width,sen_pause],out_aud)
88
  b.load(init,None,names)
89
 
90
  b.queue().launch(max_threads=40)