Spaces:
Build error
Build error
enabled youtube
Browse files
app.py
CHANGED
|
@@ -33,13 +33,13 @@ audio_mode = []
|
|
| 33 |
f0method_mode = []
|
| 34 |
f0method_info = ""
|
| 35 |
if limitation is True:
|
| 36 |
-
audio_mode = ["Upload audio", "TTS Audio"]
|
| 37 |
f0method_mode = ["pm", "crepe", "harvest"]
|
| 38 |
-
f0method_info = "PM is fast, Crepe is good but it was extremely slow (Default: PM)"
|
| 39 |
else:
|
| 40 |
audio_mode = ["Upload audio", "Youtube", "TTS Audio"]
|
| 41 |
-
f0method_mode = ["pm", "
|
| 42 |
-
f0method_info = "PM is fast,
|
| 43 |
def create_vc_fn(model_title, tgt_sr, net_g, vc, if_f0, version, file_index):
|
| 44 |
def vc_fn(
|
| 45 |
vc_audio_mode,
|
|
@@ -63,7 +63,7 @@ def create_vc_fn(model_title, tgt_sr, net_g, vc, if_f0, version, file_index):
|
|
| 63 |
return "You need to upload an audio", None
|
| 64 |
sampling_rate, audio = vc_upload
|
| 65 |
duration = audio.shape[0] / sampling_rate
|
| 66 |
-
if duration >
|
| 67 |
return "Please upload an audio file that is less than 1 minute.", None
|
| 68 |
audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
|
| 69 |
if len(audio.shape) > 1:
|
|
|
|
| 33 |
f0method_mode = []
|
| 34 |
f0method_info = ""
|
| 35 |
if limitation is True:
|
| 36 |
+
audio_mode = ["Upload audio", "Youtube", "TTS Audio"]
|
| 37 |
f0method_mode = ["pm", "crepe", "harvest"]
|
| 38 |
+
f0method_info = "PM is fast, Crepe or harvest is good but it was extremely slow (Default: PM)"
|
| 39 |
else:
|
| 40 |
audio_mode = ["Upload audio", "Youtube", "TTS Audio"]
|
| 41 |
+
f0method_mode = ["pm", "crepe", "harvest"]
|
| 42 |
+
f0method_info = "PM is fast, Crepe or harvest is good but it was extremely slow (Default: PM))"
|
| 43 |
def create_vc_fn(model_title, tgt_sr, net_g, vc, if_f0, version, file_index):
|
| 44 |
def vc_fn(
|
| 45 |
vc_audio_mode,
|
|
|
|
| 63 |
return "You need to upload an audio", None
|
| 64 |
sampling_rate, audio = vc_upload
|
| 65 |
duration = audio.shape[0] / sampling_rate
|
| 66 |
+
if duration > 360 and limitation:
|
| 67 |
return "Please upload an audio file that is less than 1 minute.", None
|
| 68 |
audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
|
| 69 |
if len(audio.shape) > 1:
|