DHEIVER commited on
Commit
d8952f8
1 Parent(s): 24d6435

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -14,14 +14,18 @@ def synthesize_speech(text, speaker_id):
14
  sf.write("speech.wav", speech["audio"], samplerate=speech["sampling_rate"])
15
  return "speech.wav"
16
 
17
- # Define your interface
18
  iface = gr.Interface(
19
  fn=synthesize_speech,
20
- inputs=[gr.Textbox(label="Enter your text"), gr.Slider(minimum=0, maximum=len(embeddings_dataset)-1, label="Speaker ID")],
21
- outputs="audio",
22
- title="Text-to-Speech Synthesizer",
23
- description="Type a text and choose a speaker to synthesize speech."
 
 
 
 
 
24
  )
25
 
26
- # Launch the app
27
  iface.launch()
 
14
  sf.write("speech.wav", speech["audio"], samplerate=speech["sampling_rate"])
15
  return "speech.wav"
16
 
17
+ # Improved Interface
18
  iface = gr.Interface(
19
  fn=synthesize_speech,
20
+ inputs=[
21
+ gr.Textbox(label="Enter Text", placeholder="Type here to practice English pronunciation..."),
22
+ gr.Slider(minimum=0, maximum=len(embeddings_dataset)-1, label="Select Speaker Voice")
23
+ ],
24
+ outputs=gr.Audio(label="Pronunciation Audio"),
25
+ title="English Pronunciation Helper",
26
+ description="This tool helps you practice English pronunciation. Type any text in English, and hear how it's pronounced.",
27
+ theme="huggingface", # You can choose different themes
28
+ layout="vertical" # For a top-down layout
29
  )
30
 
 
31
  iface.launch()