Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -40,12 +40,12 @@ def convert_to_wav(input_audio_file):
|
|
40 |
return "temp.wav"
|
41 |
return input_audio_file
|
42 |
|
43 |
-
def synthesize_text(text, input_audio_file, language
|
44 |
input_audio_file = convert_to_wav(input_audio_file)
|
45 |
-
tts.tts_to_file(text=text, speaker_wav=input_audio_file, language=language, file_path="./output.wav"
|
46 |
return "./output.wav"
|
47 |
|
48 |
-
def clone(text, input_file, language, url=None, use_url=False
|
49 |
if use_url:
|
50 |
if url is None:
|
51 |
return None
|
@@ -57,12 +57,12 @@ def clone(text, input_file, language, url=None, use_url=False, pitch=1.0):
|
|
57 |
return None
|
58 |
input_audio_file = input_file.name
|
59 |
|
60 |
-
output_file_path = synthesize_text(text, input_audio_file, language
|
61 |
return output_file_path
|
62 |
|
63 |
iface = gr.Interface(
|
64 |
fn=clone,
|
65 |
-
inputs=["text", gr.File(label="Input File", file_types=AUDIO_FORMATS), gr.Dropdown(choices=LANGUAGES, label="Language"), gr.Text(label="URL"), gr.Checkbox(label="Use URL"
|
66 |
outputs=gr.Audio(type='filepath'),
|
67 |
title='Voice Clone',
|
68 |
description=""" by [Angetyde](https://youtube.com/@Angetyde?si=7nusP31nTumIkPTF) and [Tony Assi](https://www.tonyassi.com/ ) use this colab with caution <3.""",
|
|
|
40 |
return "temp.wav"
|
41 |
return input_audio_file
|
42 |
|
43 |
+
def synthesize_text(text, input_audio_file, language):
|
44 |
input_audio_file = convert_to_wav(input_audio_file)
|
45 |
+
tts.tts_to_file(text=text, speaker_wav=input_audio_file, language=language, file_path="./output.wav")
|
46 |
return "./output.wav"
|
47 |
|
48 |
+
def clone(text, input_file, language, url=None, use_url=False):
|
49 |
if use_url:
|
50 |
if url is None:
|
51 |
return None
|
|
|
57 |
return None
|
58 |
input_audio_file = input_file.name
|
59 |
|
60 |
+
output_file_path = synthesize_text(text, input_audio_file, language)
|
61 |
return output_file_path
|
62 |
|
63 |
iface = gr.Interface(
|
64 |
fn=clone,
|
65 |
+
inputs=["text", gr.File(label="Input File", file_types=AUDIO_FORMATS), gr.Dropdown(choices=LANGUAGES, label="Language"), gr.Text(label="URL"), gr.Checkbox(label="Use URL")],
|
66 |
outputs=gr.Audio(type='filepath'),
|
67 |
title='Voice Clone',
|
68 |
description=""" by [Angetyde](https://youtube.com/@Angetyde?si=7nusP31nTumIkPTF) and [Tony Assi](https://www.tonyassi.com/ ) use this colab with caution <3.""",
|