Spaces:
Runtime error
Runtime error
XiaoHei Studio
commited on
Commit
•
d83445d
1
Parent(s):
53c22c7
Update app.py
Browse files
app.py
CHANGED
@@ -433,9 +433,9 @@ def vc_infer(output_format, sid, input_audio, sr, input_audio_path, vc_transform
|
|
433 |
input_audio = librosa.to_mono(input_audio.transpose(1, 0))
|
434 |
if sr != 44100:
|
435 |
input_audio = librosa.resample(input_audio, orig_sr=sr, target_sr=44100)
|
436 |
-
sf.write("temp.wav", input_audio, 44100, format="wav")
|
437 |
_audio = model.slice_inference(
|
438 |
-
"temp.wav",
|
439 |
sid,
|
440 |
vc_transform,
|
441 |
slice_db,
|
@@ -489,7 +489,7 @@ def vc_fn(output_format, sid, input_audio, vc_transform, auto_f0, cluster_ratio,
|
|
489 |
return "你还未加载聚类或特征检索模型,无法启用聚类/特征检索混合比例", None
|
490 |
audio, sr = sf.read(input_audio)
|
491 |
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)
|
492 |
-
os.remove("temp.wav")
|
493 |
return "Success", output_file_path
|
494 |
except Exception as e:
|
495 |
if debug:
|
|
|
433 |
input_audio = librosa.to_mono(input_audio.transpose(1, 0))
|
434 |
if sr != 44100:
|
435 |
input_audio = librosa.resample(input_audio, orig_sr=sr, target_sr=44100)
|
436 |
+
sf.write("/tmp/temp.wav", input_audio, 44100, format="wav")
|
437 |
_audio = model.slice_inference(
|
438 |
+
"/tmp/temp.wav",
|
439 |
sid,
|
440 |
vc_transform,
|
441 |
slice_db,
|
|
|
489 |
return "你还未加载聚类或特征检索模型,无法启用聚类/特征检索混合比例", None
|
490 |
audio, sr = sf.read(input_audio)
|
491 |
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)
|
492 |
+
os.remove("/tmp/temp.wav")
|
493 |
return "Success", output_file_path
|
494 |
except Exception as e:
|
495 |
if debug:
|