Spaces:
Running
Running
Guenter Bartsch
commited on
Commit
·
b8c03ff
1
Parent(s):
41889ec
update UI
Browse files- .gitignore +1 -0
- app.py +10 -11
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
run.sh
|
app.py
CHANGED
@@ -24,11 +24,11 @@ def update_text_input():
|
|
24 |
st.session_state.text = "Welcome to the world of speech synthesis!"
|
25 |
elif st.session_state['lang'] == "de":
|
26 |
st.session_state.text = "Willkommen in der Welt der Sprachsynthese!"
|
27 |
-
text = st.session_state.text
|
28 |
|
29 |
def do_synth():
|
30 |
|
31 |
-
global lang, status, speakerref,
|
32 |
|
33 |
|
34 |
synth = None
|
@@ -68,7 +68,7 @@ def do_synth():
|
|
68 |
|
69 |
start_time = time.time()
|
70 |
|
71 |
-
wav, phoneme, length = synth.tts(text, spkemb)
|
72 |
|
73 |
elapsed_time = time.time() - start_time
|
74 |
|
@@ -88,33 +88,32 @@ def do_synth():
|
|
88 |
|
89 |
st.markdown("# ZeroVOX TTS Demo\n\nZeroVOX is a zero-shot realtime TTS system, fully offline, free and open source.\n\nFor more information, check out\n[https://github.com/gooofy/zerovox](https://github.com/gooofy/zerovox)\n")
|
90 |
|
91 |
-
|
92 |
|
93 |
-
with
|
94 |
lang = st.selectbox("Language",
|
95 |
["en", "de"],
|
96 |
on_change=update_text_input,
|
97 |
key='lang')
|
98 |
|
99 |
-
with col2:
|
100 |
-
|
101 |
speakers = [s for s in ZeroVoxTTS.available_speakerrefs()]
|
102 |
|
103 |
speakerref = st.selectbox("Voice sample", speakers, index=speakers.index(DEFAULT_SPEAKER))
|
104 |
|
105 |
st.audio(ZeroVoxTTS.get_speakerref(speakerref, SAMPLE_RATE), sample_rate=SAMPLE_RATE)
|
106 |
|
107 |
-
with
|
108 |
meldec = st.selectbox("MEL decoder",
|
109 |
["meldec-libritts-multi-band-melgan-v2", "meldec-libritts-hifigan-v1"],
|
110 |
#on_change=update_text_input,
|
111 |
key='meldec')
|
112 |
|
113 |
-
|
114 |
|
115 |
-
st.
|
|
|
116 |
|
117 |
-
|
118 |
|
119 |
if 'wav' in st.session_state:
|
120 |
|
|
|
24 |
st.session_state.text = "Welcome to the world of speech synthesis!"
|
25 |
elif st.session_state['lang'] == "de":
|
26 |
st.session_state.text = "Willkommen in der Welt der Sprachsynthese!"
|
27 |
+
#text = st.session_state.text
|
28 |
|
29 |
def do_synth():
|
30 |
|
31 |
+
global lang, status, speakerref, playback, meldec
|
32 |
|
33 |
|
34 |
synth = None
|
|
|
68 |
|
69 |
start_time = time.time()
|
70 |
|
71 |
+
wav, phoneme, length = synth.tts(st.session_state.text, spkemb)
|
72 |
|
73 |
elapsed_time = time.time() - start_time
|
74 |
|
|
|
88 |
|
89 |
st.markdown("# ZeroVOX TTS Demo\n\nZeroVOX is a zero-shot realtime TTS system, fully offline, free and open source.\n\nFor more information, check out\n[https://github.com/gooofy/zerovox](https://github.com/gooofy/zerovox)\n")
|
90 |
|
91 |
+
tab1, tab2 = st.tabs(["Settings", "MEL Decoder"])
|
92 |
|
93 |
+
with tab1:
|
94 |
lang = st.selectbox("Language",
|
95 |
["en", "de"],
|
96 |
on_change=update_text_input,
|
97 |
key='lang')
|
98 |
|
|
|
|
|
99 |
speakers = [s for s in ZeroVoxTTS.available_speakerrefs()]
|
100 |
|
101 |
speakerref = st.selectbox("Voice sample", speakers, index=speakers.index(DEFAULT_SPEAKER))
|
102 |
|
103 |
st.audio(ZeroVoxTTS.get_speakerref(speakerref, SAMPLE_RATE), sample_rate=SAMPLE_RATE)
|
104 |
|
105 |
+
with tab2:
|
106 |
meldec = st.selectbox("MEL decoder",
|
107 |
["meldec-libritts-multi-band-melgan-v2", "meldec-libritts-hifigan-v1"],
|
108 |
#on_change=update_text_input,
|
109 |
key='meldec')
|
110 |
|
111 |
+
status = st.status(st.session_state.message, state="complete")
|
112 |
|
113 |
+
#text = st.text_input("Text to synthesize", value=st.session_state.text, key='text', on_change=do_synth)
|
114 |
+
text = st.text_input("Text to synthesize", key='text', on_change=do_synth)
|
115 |
|
116 |
+
st.button("Synthesize!", type="primary", on_click=do_synth)
|
117 |
|
118 |
if 'wav' in st.session_state:
|
119 |
|