sox_utils¶
Module to change the configuration of libsox, which is used by I/O functions like
sox_io_backend and sox_effects.
Warning
Starting with version 2.8, we are refactoring TorchAudio to transition it into a maintenance phase. As a result:
Some APIs are deprecated in 2.8 and will be removed in 2.9.
The decoding and encoding capabilities of PyTorch for both audio and video are being consolidated into TorchCodec.
Please see https://github.com/pytorch/audio/issues/3902 for more information.
get_buffer_size¶
- torchaudio.utils.sox_utils.get_buffer_size() int[source]¶
 DEPRECATED
Warning
This function has been deprecated. It will be removed from 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.
Get buffer size for sox effect chain
- Returns
 size in bytes of buffers used for processing audio.
- Return type
 
list_effects¶
- torchaudio.utils.sox_utils.list_effects() Dict[str, str][source]¶
 DEPRECATED
Warning
This function has been deprecated. It will be removed from 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.
List the available sox effect names
list_read_formats¶
- torchaudio.utils.sox_utils.list_read_formats() List[str][source]¶
 DEPRECATED
Warning
This function has been deprecated. It will be removed from 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.
List the supported audio formats for read
- Returns
 List of supported audio formats
- Return type
 List[str]
list_write_formats¶
- torchaudio.utils.sox_utils.list_write_formats() List[str][source]¶
 DEPRECATED
Warning
This function has been deprecated. It will be removed from 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.
List the supported audio formats for write
- Returns
 List of supported audio formats
- Return type
 List[str]
set_buffer_size¶
- torchaudio.utils.sox_utils.set_buffer_size(buffer_size: int)[source]¶
 DEPRECATED
Warning
This function has been deprecated. It will be removed from 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.
Set buffer size for sox effect chain
- Parameters
 buffer_size (int) – Set the size in bytes of the buffers used for processing audio.
See also
set_seed¶
- torchaudio.utils.sox_utils.set_seed(seed: int)[source]¶
 DEPRECATED
Warning
This function has been deprecated. It will be removed from 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.
Set libsox’s PRNG
- Parameters
 seed (int) – seed value. valid range is int32.
See also
set_use_threads¶
- torchaudio.utils.sox_utils.set_use_threads(use_threads: bool)[source]¶
 DEPRECATED
Warning
This function has been deprecated. It will be removed from 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.
Set multithread option for sox effect chain
- Parameters
 use_threads (bool) – When
True, enableslibsox’s parallel effects channels processing. To use mutlithread, the underlyinglibsoxhas to be compiled with OpenMP support.
See also
set_verbosity¶
- torchaudio.utils.sox_utils.set_verbosity(verbosity: int)[source]¶
 DEPRECATED
Warning
This function has been deprecated. It will be removed from 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.
Set libsox’s verbosity
- Parameters
 verbosity (int) –
Set verbosity level of libsox.
1failure messages2warnings3details of processing4-6increasing levels of debug messages
See also