Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,8 @@ 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
|
@@ -38,11 +40,15 @@ def audio_tts(txt, language, audio_file):
|
|
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 |
|
|
|
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 |
+
api_deu = TTS(f"tts_models/deu/fairseq/vits", gpu=False) # German, Standard
|
18 |
+
api_ara = TTS(f"tts_models/ara/fairseq/vits", gpu=False) # Arabic
|
19 |
|
20 |
def audio_tts(txt, language, audio_file):
|
21 |
global count
|
|
|
40 |
api_fas.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
41 |
elif language == "tur":
|
42 |
api_tur.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
43 |
+
elif language == "deu":
|
44 |
+
api_deu.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
45 |
+
elif language == "ara":
|
46 |
+
api_ara.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
47 |
return "ouptut.wav"
|
48 |
|
49 |
|
50 |
demo = gr.Interface(fn=audio_tts, inputs=[gr.Textbox(label="Input text TTS", value="Привет! Я Макс."),
|
51 |
+
gr.Dropdown(choices=["rus", "eng", "spa", "fas", "tur", "deu", "ara"],label="Language", value="rus"),
|
52 |
gr.Audio(source="upload", type="filepath", label="Input audio")],
|
53 |
outputs=gr.Audio(source="upload", type="filepath", label="Output audio"))
|
54 |
|