tykiww commited on
Commit
45fac78
·
verified ·
1 Parent(s): 12f46da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -18,9 +18,11 @@ tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)
18
 
19
 
20
  @spaces.GPU
21
- def generate_speech(text, speaker_wav, language):
22
  # Generate speech using the provided text, speaker voice, and language
23
  file_path = "output.wav"
 
 
24
  tts.tts_to_file(text=text,
25
  file_path=file_path,
26
  speaker_wav=speaker_wav,
@@ -31,13 +33,15 @@ def generate_speech(text, speaker_wav, language):
31
  interface = gr.Interface(
32
  fn=generate_speech,
33
  inputs=[
34
- gr.Textbox(label="Enter your text"),
35
- gr.Textbox(label="Path to target speaker WAV file", value="/content/speaker.wav"),
36
- gr.Dropdown(label="Language", choices=["en"], value="en")
37
  ],
38
  outputs="audio",
39
- title="Voice Synthesis and Cloning with Coqui-XTTS",
40
- description="Synthesize speech using a target voice and language."
41
  )
42
  # Launch the interface
43
- interface.launch()
 
 
 
18
 
19
 
20
  @spaces.GPU
21
+ def generate_speech(text):
22
  # Generate speech using the provided text, speaker voice, and language
23
  file_path = "output.wav"
24
+ speaker_wav = "/content/speaker.wav"
25
+ language = "en"
26
  tts.tts_to_file(text=text,
27
  file_path=file_path,
28
  speaker_wav=speaker_wav,
 
33
  interface = gr.Interface(
34
  fn=generate_speech,
35
  inputs=[
36
+ gr.Textbox(label="Enter your text")
37
+ #gr.Textbox(label="Path to target speaker WAV file", value="/content/speaker.wav")
38
+ #gr.Dropdown(label="Language", choices=["en"], value="en")
39
  ],
40
  outputs="audio",
41
+ title="Voice Synthesis with Coqui-XTTS",
42
+ description="Synthesize speech using predefined target voice and language."
43
  )
44
  # Launch the interface
45
+ interface.launch()
46
+
47
+