Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -52,7 +52,9 @@ def synthesize_text(text, input_audio_file, language):
|
|
52 |
tts.tts_to_file(text=text, speaker_wav=input_audio_file, language=language, file_path="./output.wav")
|
53 |
return "./output.wav"
|
54 |
|
55 |
-
def clone(text, input_file, language):
|
|
|
|
|
56 |
if input_file is None:
|
57 |
return None
|
58 |
if input_file.name.endswith(".zip"):
|
@@ -69,11 +71,7 @@ def clone(text, input_file, language):
|
|
69 |
|
70 |
iface = gr.Interface(
|
71 |
fn=clone,
|
72 |
-
inputs=["text", gr.File(label="Input File", file_types=[".zip", *AUDIO_FORMATS]), gr.Dropdown(choices=LANGUAGES, label="Language")],
|
73 |
outputs=gr.Audio(type='filepath'),
|
74 |
title='Voice Clone',
|
75 |
-
description=""" by [Angetyde](https://youtube.com/@Angetyde?si=
|
76 |
-
theme=gr.themes.Base(primary_hue="teal", secondary_hue="teal", neutral_hue="slate")
|
77 |
-
)
|
78 |
-
|
79 |
-
iface.launch(share=True)
|
|
|
52 |
tts.tts_to_file(text=text, speaker_wav=input_audio_file, language=language, file_path="./output.wav")
|
53 |
return "./output.wav"
|
54 |
|
55 |
+
def clone(text, input_file, language, url=None):
|
56 |
+
if url is not None:
|
57 |
+
input_file = download_audio_file(url)
|
58 |
if input_file is None:
|
59 |
return None
|
60 |
if input_file.name.endswith(".zip"):
|
|
|
71 |
|
72 |
iface = gr.Interface(
|
73 |
fn=clone,
|
74 |
+
inputs=["text", gr.File(label="Input File", file_types=[".zip", *AUDIO_FORMATS]), gr.Dropdown(choices=LANGUAGES, label="Language"), gr.inputs.Textbox(label="URL", lines=1)],
|
75 |
outputs=gr.Audio(type='filepath'),
|
76 |
title='Voice Clone',
|
77 |
+
description=""" by [Angetyde](https://youtube.com/@Angetyde?si=
|
|
|
|
|
|
|
|