broadfield-dev commited on
Commit
ed2af20
·
verified ·
1 Parent(s): 2e681b7

Adding file test: app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -1,22 +1,18 @@
1
- import gradio as gr
2
  from gtts import gTTS
3
- import os
4
 
5
- def text_to_speech(text, lang):
6
- tts = gTTS(text, lang=lang)
7
  tts.save("output.mp3")
8
  return "output.mp3"
9
 
10
  iface = gr.Interface(
11
  fn=text_to_speech,
12
- inputs=[
13
- gr.inputs.Textbox(lines=2, placeholder="Enter text here..."),
14
- gr.inputs.Radio(["en", "es", "fr", "de", "it", "pt"], label="Language", default="en")
15
- ],
16
  outputs="audio",
17
  title="Text to Speech Converter",
18
- description="Convert text into speech in various languages."
19
  )
20
 
21
  if __name__ == "__main__":
22
- iface.launch()
 
1
+ import gradio as gr
2
  from gtts import gTTS
 
3
 
4
+ def text_to_speech(text):
5
+ tts = gTTS(text)
6
  tts.save("output.mp3")
7
  return "output.mp3"
8
 
9
  iface = gr.Interface(
10
  fn=text_to_speech,
11
+ inputs="text",
 
 
 
12
  outputs="audio",
13
  title="Text to Speech Converter",
14
+ description="Enter text and convert it to speech."
15
  )
16
 
17
  if __name__ == "__main__":
18
+ iface.launch()