speechbrain.utils.torch_audio_backend module
Library for checking the torchaudio backend.
Summary
Functions:
Checks the torchaudio backend and sets it to soundfile if windows is detected. |
|
Tries parsing the torchaudio major and minor version. |
|
Validates the specified audio backend. |
Reference
- speechbrain.utils.torch_audio_backend.try_parse_torchaudio_major_version() tuple | None[source]
Tries parsing the torchaudio major and minor version.
- Returns:
A (major, minor) tuple, otherwise
None.- Return type:
tuple or None
- speechbrain.utils.torch_audio_backend.check_torchaudio_backend()[source]
Checks the torchaudio backend and sets it to soundfile if windows is detected.
- speechbrain.utils.torch_audio_backend.validate_backend(backend)[source]
Validates the specified audio backend.
- Parameters:
backend (str or None) – The name of the backend to validate. Must be one of [None, ‘ffmpeg’, ‘sox’, ‘soundfile’].
- Raises:
ValueError – If the
backendis not one of the allowed values.