Add files via upload

This commit is contained in:
RVC-Boss
2023-04-27 23:34:03 +08:00
committed by GitHub
parent a149107c5a
commit af208d5210
5 changed files with 352 additions and 326 deletions

View File

@@ -13,7 +13,7 @@ from scipy.io import wavfile
class _audio_pre_:
def __init__(self, model_path, device, is_half):
def __init__(self, agg,model_path, device, is_half):
self.model_path = model_path
self.device = device
self.data = {
@@ -22,7 +22,7 @@ class _audio_pre_:
"tta": False,
# Constants
"window_size": 512,
"agg": 10,
"agg": agg,
"high_end_process": "mirroring",
}
nn_arch_sizes = [
@@ -139,7 +139,7 @@ class _audio_pre_:
wav_instrument = spec_utils.cmb_spectrogram_to_wave(y_spec_m, self.mp)
print("%s instruments done" % name)
wavfile.write(
os.path.join(ins_root, "instrument_{}.wav".format(name)),
os.path.join(ins_root, "instrument_{}_{}.wav".format(name,self.data["agg"])),
self.mp.param["sr"],
(np.array(wav_instrument) * 32768).astype("int16"),
) #
@@ -155,7 +155,7 @@ class _audio_pre_:
wav_vocals = spec_utils.cmb_spectrogram_to_wave(v_spec_m, self.mp)
print("%s vocals done" % name)
wavfile.write(
os.path.join(vocal_root, "vocal_{}.wav".format(name)),
os.path.join(vocal_root, "vocal_{}_{}.wav".format(name,self.data["agg"])),
self.mp.param["sr"],
(np.array(wav_vocals) * 32768).astype("int16"),
)