DLI-SLQ commited on
Commit
a5300a9
1 Parent(s): f618670

fix detect error

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -32,16 +32,15 @@ def synthesize_speech(text):
32
  # Convert buffer to NumPy array for Gradio output
33
  buffer.seek(0)
34
  audio_data = np.frombuffer(buffer.read(), dtype=np.int16)
35
-
36
  return audio_data.tobytes(), None
37
-
38
  # Using Gradio Blocks
39
  with gr.Blocks(theme=gr.themes.Base()) as blocks:
40
  gr.Markdown("# Text to Speech Synthesizer")
41
  gr.Markdown("Enter text to synthesize it into speech using models from the State Library of Queensland's collection using Piper.")
42
  input_text = gr.Textbox(label="Input Text")
43
  output_audio = gr.Audio(label="Synthesized Speech", type="numpy")
44
- output_text = gr.Textbox(label="Output Text", visible=False) # This is the new text output component
45
  submit_button = gr.Button("Synthesize")
46
 
47
  submit_button.click(synthesize_speech, inputs=input_text, outputs=[output_audio, output_text])
 
32
  # Convert buffer to NumPy array for Gradio output
33
  buffer.seek(0)
34
  audio_data = np.frombuffer(buffer.read(), dtype=np.int16)
 
35
  return audio_data.tobytes(), None
36
+
37
  # Using Gradio Blocks
38
  with gr.Blocks(theme=gr.themes.Base()) as blocks:
39
  gr.Markdown("# Text to Speech Synthesizer")
40
  gr.Markdown("Enter text to synthesize it into speech using models from the State Library of Queensland's collection using Piper.")
41
  input_text = gr.Textbox(label="Input Text")
42
  output_audio = gr.Audio(label="Synthesized Speech", type="numpy")
43
+ output_text = gr.Textbox(label="Output Text", visible=True) # Make this visible for error messages
44
  submit_button = gr.Button("Synthesize")
45
 
46
  submit_button.click(synthesize_speech, inputs=input_text, outputs=[output_audio, output_text])