Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -96,7 +96,7 @@ def create_vc_fn(model_name, tgt_sr, net_g, vc, if_f0, version, file_index):
|
|
96 |
audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
|
97 |
if len(audio.shape) > 1:
|
98 |
audio = librosa.to_mono(audio.transpose(1, 0))
|
99 |
-
if sampling_rate !=
|
100 |
audio = librosa.resample(audio, orig_sr=sampling_rate, target_sr=16000)
|
101 |
elif vc_audio_mode == "TTS Audio":
|
102 |
if len(tts_text) > 100 and spaces:
|
@@ -106,7 +106,7 @@ def create_vc_fn(model_name, tgt_sr, net_g, vc, if_f0, version, file_index):
|
|
106 |
os.makedirs("output", exist_ok=True)
|
107 |
os.makedirs(os.path.join("output", "tts"), exist_ok=True)
|
108 |
asyncio.run(edge_tts.Communicate(tts_text, "-".join(tts_voice.split('-')[:-1])).save(os.path.join("output", "tts", "tts.mp3")))
|
109 |
-
audio, sr = librosa.load(os.path.join("output", "tts", "tts.mp3"), sr=
|
110 |
vc_input = os.path.join("output", "tts", "tts.mp3")
|
111 |
times = [0, 0, 0]
|
112 |
f0_up_key = int(f0_up_key)
|
|
|
96 |
audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
|
97 |
if len(audio.shape) > 1:
|
98 |
audio = librosa.to_mono(audio.transpose(1, 0))
|
99 |
+
if sampling_rate != 1600000:
|
100 |
audio = librosa.resample(audio, orig_sr=sampling_rate, target_sr=16000)
|
101 |
elif vc_audio_mode == "TTS Audio":
|
102 |
if len(tts_text) > 100 and spaces:
|
|
|
106 |
os.makedirs("output", exist_ok=True)
|
107 |
os.makedirs(os.path.join("output", "tts"), exist_ok=True)
|
108 |
asyncio.run(edge_tts.Communicate(tts_text, "-".join(tts_voice.split('-')[:-1])).save(os.path.join("output", "tts", "tts.mp3")))
|
109 |
+
audio, sr = librosa.load(os.path.join("output", "tts", "tts.mp3"), sr=1600000, mono=True)
|
110 |
vc_input = os.path.join("output", "tts", "tts.mp3")
|
111 |
times = [0, 0, 0]
|
112 |
f0_up_key = int(f0_up_key)
|