sox_utils
Module to change the configuration of libsox, which is used by I/O functions like
sox_io_backend
and sox_effects
.
get_buffer_size
-
torchaudio.utils.sox_utils.get_buffer_size() → int[source]
Get buffer size for sox effect chain
- Returns:
size in bytes of buffers used for processing audio.
- Return type:
int
list_effects
-
torchaudio.utils.sox_utils.list_effects() → Dict[str, str][source]
List the available sox effect names
- Returns:
Mapping from effect name
to usage
- Return type:
Dict[str, str]
set_buffer_size
-
torchaudio.utils.sox_utils.set_buffer_size(buffer_size: int)[source]
Set buffer size for sox effect chain
- Parameters:
buffer_size (int) – Set the size in bytes of the buffers used for processing audio.
set_seed
-
torchaudio.utils.sox_utils.set_seed(seed: int)[source]
Set libsox’s PRNG
- Parameters:
seed (int) – seed value. valid range is int32.
set_use_threads
-
torchaudio.utils.sox_utils.set_use_threads(use_threads: bool)[source]
Set multithread option for sox effect chain
- Parameters:
use_threads (bool) – When True
, enables libsox
’s parallel effects channels processing.
To use mutlithread, the underlying libsox
has to be compiled with OpenMP support.
set_verbosity
-
torchaudio.utils.sox_utils.set_verbosity(verbosity: int)[source]
Set libsox’s verbosity
- Parameters:
verbosity (int) –
Set verbosity level of libsox.