Skip to content

Commit

Permalink
fix(torchaudio): use soundfile as torchaudio backend
Browse files Browse the repository at this point in the history
  • Loading branch information
magic-akari committed Jul 23, 2023
1 parent efed9f5 commit 43fb46e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions inference/infer_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ def infer(self, speaker, tran, raw_path,
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)
Expand Down

0 comments on commit 43fb46e

Please sign in to comment.