fix(torchaudio): use `soundfile` as torchaudio backend
This commit is contained in:
parent
efed9f5f02
commit
43fb46e64d
|
@ -267,6 +267,7 @@ class Svc(object):
|
||||||
second_encoding = False,
|
second_encoding = False,
|
||||||
loudness_envelope_adjustment = 1
|
loudness_envelope_adjustment = 1
|
||||||
):
|
):
|
||||||
|
torchaudio.set_audio_backend("soundfile")
|
||||||
wav, sr = torchaudio.load(raw_path)
|
wav, sr = torchaudio.load(raw_path)
|
||||||
if not hasattr(self,"audio_resample_transform") or self.audio16k_resample_transform.orig_freq != sr:
|
if not hasattr(self,"audio_resample_transform") or self.audio16k_resample_transform.orig_freq != sr:
|
||||||
self.audio_resample_transform = torchaudio.transforms.Resample(sr,self.target_sample)
|
self.audio_resample_transform = torchaudio.transforms.Resample(sr,self.target_sample)
|
||||||
|
|
Loading…
Reference in New Issue