Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,7 @@ api_tur = TTS(f"tts_models/tur/fairseq/vits", gpu=False) # Turkish
|
|
18 |
api_deu = TTS(f"tts_models/deu/fairseq/vits", gpu=False) # German, Standard
|
19 |
api_ara = TTS(f"tts_models/ara/fairseq/vits", gpu=False) # Arabic
|
20 |
api_por = TTS(f"tts_models/por/fairseq/vits", gpu=False) # Portuguese
|
|
|
21 |
|
22 |
|
23 |
def audio_tts(txt, language, audio_file):
|
@@ -49,11 +50,14 @@ def audio_tts(txt, language, audio_file):
|
|
49 |
api_ara.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
50 |
elif language == "por":
|
51 |
api_por.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
|
|
|
|
52 |
return "ouptut.wav"
|
53 |
|
54 |
|
55 |
demo = gr.Interface(fn=audio_tts, inputs=[gr.Textbox(label="Input text TTS", value="Привет! Я Макс."),
|
56 |
-
gr.Dropdown(choices=["rus", "eng", "spa", "fas", "tur", "deu", "ara", "por"
|
|
|
57 |
gr.Audio(source="upload", type="filepath", label="Input audio")],
|
58 |
outputs=gr.Audio(source="upload", type="filepath", label="Output audio"))
|
59 |
|
|
|
18 |
api_deu = TTS(f"tts_models/deu/fairseq/vits", gpu=False) # German, Standard
|
19 |
api_ara = TTS(f"tts_models/ara/fairseq/vits", gpu=False) # Arabic
|
20 |
api_por = TTS(f"tts_models/por/fairseq/vits", gpu=False) # Portuguese
|
21 |
+
api_hin = TTS(f"tts_models/hin/fairseq/vits", gpu=False) # Hindi
|
22 |
|
23 |
|
24 |
def audio_tts(txt, language, audio_file):
|
|
|
50 |
api_ara.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
51 |
elif language == "por":
|
52 |
api_por.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
53 |
+
elif language == "hin":
|
54 |
+
api_hin.tts_with_vc_to_file(txt, speaker_wav=audio_file, file_path="ouptut.wav")
|
55 |
return "ouptut.wav"
|
56 |
|
57 |
|
58 |
demo = gr.Interface(fn=audio_tts, inputs=[gr.Textbox(label="Input text TTS", value="Привет! Я Макс."),
|
59 |
+
gr.Dropdown(choices=["rus", "eng", "spa", "fas", "tur", "deu", "ara", "por", "hin"],
|
60 |
+
label="Language", value="rus"),
|
61 |
gr.Audio(source="upload", type="filepath", label="Input audio")],
|
62 |
outputs=gr.Audio(source="upload", type="filepath", label="Output audio"))
|
63 |
|