Spaces:
Runtime error
Runtime error
XiaoHei Studio
commited on
Commit
•
53c22c7
1
Parent(s):
907324f
Update app.py
Browse files
app.py
CHANGED
@@ -535,13 +535,13 @@ def tts_fn(_text, _gender, _lang, _rate, _volume, output_format, sid, vc_transfo
|
|
535 |
else:
|
536 |
subprocess.run([r"python", "tts.py", _text, _lang, _rate, _volume])
|
537 |
target_sr = 44100
|
538 |
-
y, sr = librosa.load("tts.wav")
|
539 |
resampled_y = librosa.resample(y, orig_sr=sr, target_sr=target_sr)
|
540 |
-
sf.write("tts.wav", resampled_y, target_sr, subtype = "PCM_16")
|
541 |
-
input_audio = "tts.wav"
|
542 |
audio, sr = sf.read(input_audio)
|
543 |
output_file_path = vc_infer(output_format, sid, audio, sr, input_audio, vc_transform, auto_f0, cluster_ratio, slice_db, noise_scale, pad_seconds, cl_num, lg_num, lgr_num, f0_predictor, enhancer_adaptive_key, cr_threshold, k_step, use_spk_mix, second_encoding, loudness_envelope_adjustment)
|
544 |
-
#os.remove("tts.wav")
|
545 |
return "Success", output_file_path
|
546 |
except Exception as e:
|
547 |
if debug:
|
|
|
535 |
else:
|
536 |
subprocess.run([r"python", "tts.py", _text, _lang, _rate, _volume])
|
537 |
target_sr = 44100
|
538 |
+
y, sr = librosa.load("/tmp/tts.wav")
|
539 |
resampled_y = librosa.resample(y, orig_sr=sr, target_sr=target_sr)
|
540 |
+
sf.write("/tmp/tts.wav", resampled_y, target_sr, subtype = "PCM_16")
|
541 |
+
input_audio = "/tmp/tts.wav"
|
542 |
audio, sr = sf.read(input_audio)
|
543 |
output_file_path = vc_infer(output_format, sid, audio, sr, input_audio, vc_transform, auto_f0, cluster_ratio, slice_db, noise_scale, pad_seconds, cl_num, lg_num, lgr_num, f0_predictor, enhancer_adaptive_key, cr_threshold, k_step, use_spk_mix, second_encoding, loudness_envelope_adjustment)
|
544 |
+
#os.remove("/tmp/tts.wav")
|
545 |
return "Success", output_file_path
|
546 |
except Exception as e:
|
547 |
if debug:
|