Skip to content

Commit

Permalink
bug fix Pretrained.load_audio
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel oexle committed Feb 16, 2022
1 parent 9d56d50 commit 625cda7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions speechbrain/pretrained/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,15 @@ def _prepare_modules(self, freeze_params):
for p in self.mods.parameters():
p.requires_grad = False

def load_audio(self, path, savedir="."):
def load_audio(self, path):
"""Load an audio file with this model"s input spec
When using a speech model, it is important to use the same type of data,
as was used to train the model. This means for example using the same
sampling rate and number of channels. It is, however, possible to
convert a file from a higher sampling rate to a lower one (downsampling).
Similarly, it is simple to downmix a stereo file to mono.
The path can be a local path, a web url, or a link to a huggingface repo.
"""
source, fl = split_path(path)
path = fetch(fl, source=source, savedir=savedir)
signal, sr = torchaudio.load(str(path), channels_first=False)
return self.audio_normalizer(signal, sr)

Expand Down

0 comments on commit 625cda7

Please sign in to comment.