Skip to content

AttributeError: module 'torchaudio' has no attribute 'list_audio_backends' #3012

@matrn

Description

@matrn

Describe the bug

The check_torchaudio_backend function calls the torchaudio.list_audio_backends() but this function is deprecated since version 2.9 - https://docs.pytorch.org/audio/main/generated/torchaudio.list_audio_backends.html - which causes:

...
...speechbrain/utils/torch_audio_backend.py", line 57, in check_torchaudio_backend
    available_backends = torchaudio.list_audio_backends()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'torchaudio' has no attribute 'list_audio_backends'

Expected behaviour

Not caussing AttributeError

To Reproduce

from speechbrain.inference.speaker import EncoderClassifier

EncoderClassifier.from_hparams(
    source="speechbrain/spkrec-ecapa-voxceleb",
    savedir="pretrained_models/spkrec-ecapa-voxceleb",
    run_opts={"device": "cpu"},
)

Environment Details

speechbrain==1.0.3
torch==2.9.1+cpu
torchaudio==2.9.1+cpu
torchcodec==0.8.1

Relevant Log Output

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions