zelk12 commited on
Commit
8d52ab1
1 Parent(s): d65174e

Fixed phoneme recording error

Browse files

Fixed a bug that was listed here:
https://huggingface.co/spaces/Plachta/VITS-Umamusume-voice-synthesizer/discussions/5

Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -262,9 +262,9 @@ if __name__ == "__main__":
262
  symbol_input.change(to_symbol_fn,
263
  [symbol_input, textbox, temp_text_var],
264
  [textbox, temp_text_var])
265
- symbol_list.click(None, [symbol_list, symbol_list_json], [],
266
  _js=f"""
267
- (i, symbols) => {{
268
  let root = document.querySelector("body > gradio-app");
269
  if (root.shadowRoot != null)
270
  root = root.shadowRoot;
@@ -280,7 +280,10 @@ if __name__ == "__main__":
280
  text_input.selectionEnd = startPos + symbols[i].length;
281
  text_input.blur();
282
  window.scrollTo(x, y);
283
- return [];
 
 
 
284
  }}""")
285
  # select character
286
  char_dropdown = gr.Dropdown(choices=characters, value = "0:特别周", label='character')
 
262
  symbol_input.change(to_symbol_fn,
263
  [symbol_input, textbox, temp_text_var],
264
  [textbox, temp_text_var])
265
+ symbol_list.click(None, [symbol_list, symbol_list_json], textbox,
266
  _js=f"""
267
+ (i, symbols, text) => {{
268
  let root = document.querySelector("body > gradio-app");
269
  if (root.shadowRoot != null)
270
  root = root.shadowRoot;
 
280
  text_input.selectionEnd = startPos + symbols[i].length;
281
  text_input.blur();
282
  window.scrollTo(x, y);
283
+
284
+ text = text_input.value;
285
+
286
+ return text;
287
  }}""")
288
  # select character
289
  char_dropdown = gr.Dropdown(choices=characters, value = "0:特别周", label='character')