Guenter Bartsch commited on
Commit
41889ec
·
1 Parent(s): f099617

update layout, default speaker

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -7,6 +7,8 @@ from zerovox.g2p.g2p import DEFAULT_G2P_MODEL_NAME_DE, DEFAULT_G2P_MODEL_NAME_EN
7
 
8
  SAMPLE_RATE=24000 # FIXME
9
 
 
 
10
  if "text" not in st.session_state:
11
  st.session_state.text = "Welcome to the world of speech synthesis!"
12
 
@@ -86,7 +88,7 @@ def do_synth():
86
 
87
  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")
88
 
89
- col1, col2 = st.columns(2)
90
 
91
  with col1:
92
  lang = st.selectbox("Language",
@@ -94,19 +96,23 @@ with col1:
94
  on_change=update_text_input,
95
  key='lang')
96
 
97
- text = st.text_input("Text to synthesize", value=st.session_state.text)
 
 
98
 
99
- st.button("Synthesize!", type="primary", on_click=do_synth)
100
 
101
- with col2:
 
 
102
  meldec = st.selectbox("MEL decoder",
103
  ["meldec-libritts-multi-band-melgan-v2", "meldec-libritts-hifigan-v1"],
104
  #on_change=update_text_input,
105
  key='meldec')
106
 
107
- speakerref = st.selectbox("Voice sample", ZeroVoxTTS.available_speakerrefs())
108
 
109
- st.audio(ZeroVoxTTS.get_speakerref(speakerref, SAMPLE_RATE), sample_rate=SAMPLE_RATE)
110
 
111
  status = st.status(st.session_state.message, state="complete")
112
 
 
7
 
8
  SAMPLE_RATE=24000 # FIXME
9
 
10
+ DEFAULT_SPEAKER = 'en_speaker_00061.wav'
11
+
12
  if "text" not in st.session_state:
13
  st.session_state.text = "Welcome to the world of speech synthesis!"
14
 
 
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
+ col1, col2, col3 = st.columns(3)
92
 
93
  with col1:
94
  lang = st.selectbox("Language",
 
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 col3:
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
+ text = st.text_input("Text to synthesize", value=st.session_state.text)
114
 
115
+ st.button("Synthesize!", type="primary", on_click=do_synth)
116
 
117
  status = st.status(st.session_state.message, state="complete")
118