coraKong commited on
Commit
3c1ae3c
·
1 Parent(s): 47a350b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -4,14 +4,13 @@ from TTS.api import TTS
4
  # List available 🐸TTS models and choose the first one
5
  model_name = TTS.list_models()[0]
6
  # Init TTS
7
- tts = TTS(model_name)
8
 
9
  def text_to_speech(text: str, speaker_wav, language: str):
10
  tts.tts_to_file(text, speaker_wav=speaker_wav, language=language, file_path="output.wav")
11
- # tts.tts_to_file(text=text, speaker=tts.speakers[0], language=language, file_path="output.wav")
12
  return 'output.wav'
13
 
14
- inputs = [gr.Textbox(label="Input", value="Personalized learning platform for students with learning differences: You could develop an AI-powered platform that uses adaptive learning algorithms to provide personalized learning experiences for students with learning differences such as dyslexia or ADHD. As a front-end developer, you could design and develop the user interface, while your background in psychology could inform the adaptive learning algorithms used by the platform.", max_lines=3),
15
  gr.Audio(Lable="Speaker Wav", source="microphone", type="filepath"),
16
  gr.Radio(label="Language", choices=tts.languages, value="en")]
17
  outputs = gr.Audio(label="Output")
 
4
  # List available 🐸TTS models and choose the first one
5
  model_name = TTS.list_models()[0]
6
  # Init TTS
7
+ tts = TTS(model_name, progress_bar=True, gpu=False)
8
 
9
  def text_to_speech(text: str, speaker_wav, language: str):
10
  tts.tts_to_file(text, speaker_wav=speaker_wav, language=language, file_path="output.wav")
 
11
  return 'output.wav'
12
 
13
+ inputs = [gr.Textbox(label="Input", value="Hello!", max_lines=3),
14
  gr.Audio(Lable="Speaker Wav", source="microphone", type="filepath"),
15
  gr.Radio(label="Language", choices=tts.languages, value="en")]
16
  outputs = gr.Audio(label="Output")