Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -96,17 +96,25 @@ function () {
|
|
96 |
with gr.Blocks(head=head) as app:
|
97 |
a=gr.Audio(streaming=True,autoplay=True)
|
98 |
h=gr.HTML("""<div id='cap'></div>""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
with gr.Column(visible=False):
|
100 |
-
t=gr.Textbox(label="url",interactive=False,visible=True)
|
101 |
-
m=gr.Textbox(label="mod",value="en_US-joe-medium",interactive=False,visible=True)
|
102 |
-
l=gr.Textbox(label="len",value="1",interactive=False,visible=True)
|
103 |
-
n=gr.Textbox(label="nos",value="0.5",interactive=False,visible=True)
|
104 |
-
w=gr.Textbox(label="wid",value="0.5",interactive=False,visible=True)
|
105 |
-
p=gr.Textbox(label="pau",value="1",interactive=False,visible=True)
|
106 |
bulk=gr.Textbox(label="bulk",interactive=False,visible=True)
|
107 |
|
108 |
app.load(None,None,[t,m,l,n,w,p],js=js)
|
109 |
-
t.change(read_pdf,t,bulk)
|
110 |
-
m.change(pp.load_mod,m,None)
|
111 |
-
bulk.change(pp.stream_tts,[bulk,m,l,n,w,p],a)
|
|
|
|
|
112 |
app.queue(default_concurrency_limit=20).launch(max_threads=40)
|
|
|
96 |
with gr.Blocks(head=head) as app:
|
97 |
a=gr.Audio(streaming=True,autoplay=True)
|
98 |
h=gr.HTML("""<div id='cap'></div>""")
|
99 |
+
|
100 |
+
with gr.Accordion("Voice Controls",open=False):
|
101 |
+
with gr.Row():
|
102 |
+
stp=gr.Button("Stop")
|
103 |
+
upd=gr.Button("Update Voice")
|
104 |
+
t=gr.Textbox(label="PDF URL",interactive=True,visible=True)
|
105 |
+
m=gr.Dropdown(label="Voice", choices=pp.key_list,value="en_US-lessac-high",interactive=True)
|
106 |
+
l=gr.Slider(label="Length", minimum=0.01, maximum=10.0, value=1,interactive=True)
|
107 |
+
n=gr.Slider(label="Noise", minimum=0.01, maximum=3.0, value=0.5,interactive=True)
|
108 |
+
w=gr.Slider(label="Noise Width", minimum=0.01, maximum=3.0, value=0.5,interactive=True)
|
109 |
+
p=gr.Slider(label="Sentence Pause", minimum=0.1, maximum=10.0, value=1,interactive=True)
|
110 |
+
upd_btn=gr.Button("Update")
|
111 |
with gr.Column(visible=False):
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
bulk=gr.Textbox(label="bulk",interactive=False,visible=True)
|
113 |
|
114 |
app.load(None,None,[t,m,l,n,w,p],js=js)
|
115 |
+
tc=t.change(read_pdf,t,bulk)
|
116 |
+
mc=m.change(pp.load_mod,m,None)
|
117 |
+
bc=bulk.change(pp.stream_tts,[bulk,m,l,n,w,p],a)
|
118 |
+
uc=upd.click(pp.stream_tts,[bulk,m,l,n,w,p],a)
|
119 |
+
sc=stop.click(None,None,None, cancels=[tc,mc,bc,uc])
|
120 |
app.queue(default_concurrency_limit=20).launch(max_threads=40)
|