Update app.py
Browse files
app.py
CHANGED
@@ -12,6 +12,8 @@ https://dl.fbaipublicfiles.com/mms/tts/all-tts-languages.html
|
|
12 |
api_rus = TTS(f"tts_models/rus/fairseq/vits", gpu=False)
|
13 |
api_eng = TTS(f"tts_models/eng/fairseq/vits", gpu=False)
|
14 |
api_spa = TTS(f"tts_models/spa/fairseq/vits", gpu=False)
|
|
|
|
|
15 |
|
16 |
def audio_tts(txt, language, audio_file):
|
17 |
global count
|
@@ -32,11 +34,15 @@ def audio_tts(txt, language, audio_file):
|
|
32 |
api_eng.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
33 |
elif language == "spa":
|
34 |
api_spa.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
|
|
|
|
|
|
|
|
35 |
return "ouptut.wav"
|
36 |
|
37 |
|
38 |
demo = gr.Interface(fn=audio_tts, inputs=[gr.Textbox(label="Input text TTS", value="Привет! Я Макс."),
|
39 |
-
gr.Dropdown(choices=["rus", "eng", "spa"],label="Language", value="rus"),
|
40 |
gr.Audio(source="upload", type="filepath", label="Input audio")],
|
41 |
outputs=gr.Audio(source="upload", type="filepath", label="Output audio"))
|
42 |
|
|
|
12 |
api_rus = TTS(f"tts_models/rus/fairseq/vits", gpu=False)
|
13 |
api_eng = TTS(f"tts_models/eng/fairseq/vits", gpu=False)
|
14 |
api_spa = TTS(f"tts_models/spa/fairseq/vits", gpu=False)
|
15 |
+
api_fas = TTS(f"tts_models/fas/fairseq/vits", gpu=False) # Persian
|
16 |
+
api_tur = TTS(f"tts_models/tur/fairseq/vits", gpu=False) # Turkish
|
17 |
|
18 |
def audio_tts(txt, language, audio_file):
|
19 |
global count
|
|
|
34 |
api_eng.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
35 |
elif language == "spa":
|
36 |
api_spa.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
37 |
+
elif language == "fas":
|
38 |
+
api_fas.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
39 |
+
elif language == "tur":
|
40 |
+
api_tur.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
41 |
return "ouptut.wav"
|
42 |
|
43 |
|
44 |
demo = gr.Interface(fn=audio_tts, inputs=[gr.Textbox(label="Input text TTS", value="Привет! Я Макс."),
|
45 |
+
gr.Dropdown(choices=["rus", "eng", "spa", "fas", "tur"],label="Language", value="rus"),
|
46 |
gr.Audio(source="upload", type="filepath", label="Input audio")],
|
47 |
outputs=gr.Audio(source="upload", type="filepath", label="Output audio"))
|
48 |
|