Skip to content

Conversation

@OscarFree
Copy link
Contributor

This is a temporary bandaid to prevent AttributeError when list_audio_backends() is called with torchaudio 2.9+. This does NOT fully address the upgrade to torchaudio 2.9+ and the transition to torchcodec.

Changes

  • Added hasattr() checks before calling list_audio_backends()
  • Updated check_torchaudio_backend() and validate_backend() functions
  • Prevents crash when using speechbrain with torchaudio 2.9+

Issue

Fixes #2977

Notes

This is a minimal bandaid fix to unblock users who need to use speechbrain with torchaudio 2.9+. A more comprehensive solution would involve properly migrating to torchcodec for audio loading in torchaudio 2.9+.

This is a temporary bandaid to prevent AttributeError when list_audio_backends()
is called with torchaudio 2.9+. This does NOT fully address the upgrade to
torchaudio 2.9+ and the transition to torchcodec.

Changes:
- Added hasattr() checks before calling list_audio_backends()
- Updated check_torchaudio_backend() and validate_backend() functions
- Prevents crash when using speechbrain with torchaudio 2.9+

Related to speechbrain#2977
Copy link
Collaborator

@pplantinga pplantinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, LGTM!

@pplantinga pplantinga merged commit 927530f into speechbrain:develop Oct 29, 2025
5 checks passed
@OscarFree OscarFree deleted the torchaudio-2.9-bandaid branch October 30, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UserWarning: torchaudio._backend.list_audio_backends has been deprecated

2 participants