Skip to content

Commit

Permalink
using soundfile instead of scipy in training to get more robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisewf committed Dec 27, 2024
1 parent a85d729 commit 20796fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rvc/train/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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="|"):
Expand Down

0 comments on commit 20796fd

Please sign in to comment.