From 20796fd0f8bcf1626de5960f1005dd619789821b Mon Sep 17 00:00:00 2001 From: Blaise Date: Fri, 27 Dec 2024 20:54:17 +0100 Subject: [PATCH] using soundfile instead of scipy in training to get more robustness --- rvc/train/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rvc/train/utils.py b/rvc/train/utils.py index cd4051630..e8776727c 100644 --- a/rvc/train/utils.py +++ b/rvc/train/utils.py @@ -2,7 +2,7 @@ import glob import torch import numpy as np -from scipy.io.wavfile import read +import soundfile as sf from collections import OrderedDict import matplotlib.pyplot as plt @@ -198,8 +198,8 @@ def load_wav_to_torch(full_path): Args: full_path (str): The path to the WAV file. """ - sample_rate, data = read(full_path) - return torch.FloatTensor(data.astype(np.float32)), sample_rate + data, sample_rate = sf.read(full_path, dtype='float32') + return torch.FloatTensor(data), sample_rate def load_filepaths_and_text(filename, split="|"):