GaneshSarode commited on
Commit
4f8bf39
·
verified ·
1 Parent(s): b9dc5d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -0
app.py CHANGED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from TTS.api import TTS
3
+
4
+ tts = TTS(
5
+ model_name="tts_models/multilingual/multi-dataset/xtts_v2",
6
+ gpu=False
7
+ )
8
+
9
+ def synthesize(text, speaker_wav):
10
+ out = "out.wav"
11
+ tts.tts_to_file(
12
+ text=text,
13
+ speaker_wav=speaker_wav,
14
+ language="en",
15
+ file_path=out
16
+ )
17
+ return out
18
+
19
+ ui = gr.Interface(
20
+ fn=synthesize,
21
+ inputs=[
22
+ gr.Textbox(label="Text"),
23
+ gr.Audio(type="filepath", label="Speaker voice (wav)")
24
+ ],
25
+ outputs=gr.Audio(type="filepath"),
26
+ title="XTTS Voice Cloning (CPU)"
27
+ )
28
+
29
+ ui.launch()