Skip to content

RuntimeError when using torchaudio 0.12.0 to load MP3 audio file #4776

@albertvillanova

Description

@albertvillanova

Current version of torchaudio (0.12.0) raises a RuntimeError when trying to use sox_io backend but non-Python dependency sox is not installed:
https://github.com/pytorch/audio/blob/2e1388401c434011e9f044b40bc8374f2ddfc414/torchaudio/backend/sox_io_backend.py#L21-L29

def _fail_load(
    filepath: str,
    frame_offset: int = 0,
    num_frames: int = -1,
    normalize: bool = True,
    channels_first: bool = True,
    format: Optional[str] = None,
) -> Tuple[torch.Tensor, int]:
    raise RuntimeError("Failed to load audio from {}".format(filepath))

Maybe we should raise a more actionable error message so that the user knows how to fix it.

UPDATE:

  • this is an incompatibility of latest torchaudio (0.12.0) and the sox backend

TODO:

Related to:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions