fix(torchaudio): use `soundfile` as torchaudio backend

This commit is contained in:
magic-akari 2023-07-23 21:42:29 +08:00
parent efed9f5f02
commit 43fb46e64d
No known key found for this signature in database
GPG Key ID: EC005B1159285BDD
1 changed files with 1 additions and 0 deletions

View File

@ -267,6 +267,7 @@ class Svc(object):
second_encoding = False,
loudness_envelope_adjustment = 1
):
torchaudio.set_audio_backend("soundfile")
wav, sr = torchaudio.load(raw_path)
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)