Skip to content

Commit

Permalink
not using torchaudio for reading anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
adefossez committed Oct 9, 2023
1 parent d45769c commit 58733cd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [1.0.1] - TBD

Not using torchaudio anymore when writing audio files, relying instead directly on the commandline ffmpeg.
Not using torchaudio anymore when writing audio files, relying instead directly on the commandline ffmpeg. Also not using it anymore for reading audio files, for similar reasons.

## [1.0.0] - 2023-09-07

Expand Down
6 changes: 0 additions & 6 deletions audiocraft/data/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,6 @@ def audio_read(filepath: tp.Union[str, Path], seek_time: float = 0.,
wav = torch.from_numpy(wav).t().contiguous()
if len(wav.shape) == 1:
wav = torch.unsqueeze(wav, 0)
elif (
fp.suffix in ['.wav', '.mp3'] and fp.suffix[1:] in ta.utils.sox_utils.list_read_formats()
and duration <= 0 and seek_time == 0
):
# Torchaudio is faster if we load an entire file at once.
wav, sr = ta.load(fp)
else:
wav, sr = _av_read(filepath, seek_time, duration)
if pad and duration > 0:
Expand Down

0 comments on commit 58733cd

Please sign in to comment.