pytorch / pytorch/audio

torchaudio load opus failed

Open
#3,753 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
799
Avg merge
58m
Merged PRs (30d)
3

Description

🐛 Describe the bug
>>> torchaudio.backend.soundfile_backend.load('test.opus')
(tensor([[-5.2875e-12,  2.0960e-11,  2.4085e-11,  ...,  2.9903e-06,
         -6.7451e-06,  3.6049e-05]]), 16000)
>>> torchaudio.backend.sox_io_backend.load('test.opus')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/miniconda3/envs/cloud-ai-lab/lib/python3.8/site-packages/torchaudio/backend/_sox_io_backend.py", line 126, in load
    return sox_ext.load_audio_file(filepath, frame_offset, num_frames, normalize, channels_first, format)
  File "/usr/local/lib/miniconda3/envs/cloud-ai-lab/lib/python3.8/site-packages/torch/_ops.py", line 755, in __call__
    return self._op(*args, **(kwargs or {}))
RuntimeError: Error loading audio file: failed to open file test.opus
Versions
os: ubuntu

>>> torchaudio.__version__
2.2.1+cu121 
### Tasks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported torchaudio 2.2.1 behavior on Ubuntu with test.opus, comparing soundfile_backend.load and sox_io_backend.load. Done means the sox_io backend can load the same Opus file successfully, with an appropriate regression check added if the relevant test location is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
audio-video-rtc
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.