torchaudio.utils¶
torchaudio.utils.sox_utils¶
Utility module to configure libsox. This affects functionalities in Sox IO backend and Sox Effects.
-
torchaudio.utils.sox_utils.
set_seed
(seed: int)[source]¶ Set libsox’s PRNG
- Parameters
seed (int) – seed value. valid range is int32.
See also
-
torchaudio.utils.sox_utils.
set_verbosity
(verbosity: int)[source]¶ Set libsox’s verbosity
- Parameters
verbosity (int) –
Set verbosity level of libsox.
1
failure messages2
warnings3
details of processing4
-6
increasing levels of debug messages
See also
-
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.
See also
-
torchaudio.utils.sox_utils.
set_use_threads
(use_threads: bool)[source]¶ Set multithread option for sox effect chain
- Parameters
use_threads (bool) – When
True
, enableslibsox
’s parallel effects channels processing. To use mutlithread, the underlyinglibsox
has to be compiled with OpenMP support.
See also
-
torchaudio.utils.sox_utils.
list_effects
() → Dict[str, str][source]¶ List the available sox effect names
-
torchaudio.utils.sox_utils.
list_read_formats
() → List[str][source]¶ List the supported audio formats for read
- Returns
List of supported audio formats
- Return type
List[str]
torchaudio.utils.ffmpeg_utils¶
Utility module to configure FFmpeg libraries.
-
torchaudio.utils.ffmpeg_utils.
get_log_level
() → int[source]¶ Get the log level of FFmpeg.
See
set_log_level()
for the detailo.
-
torchaudio.utils.ffmpeg_utils.
set_log_level
(level: int)[source]¶ Set the log level of FFmpeg (libavformat etc)
- Parameters
level (int) –
Log level. The larger, the more verbose.
The following values are common values, the corresponding
ffmpeg
’s-loglevel
option value and desription.-8
(quiet
): Print no output.0
(panic
): Something went really wrong and we will crash now.8
(fatal
): Something went wrong and recovery is not possible. For example, no header was found for a format which depends on headers or an illegal combination of parameters is used.16
(error
): Something went wrong and cannot losslessly be recovered. However, not all future data is affected.24
(warning
): Something somehow does not look correct. This may or may not lead to problems.32
(info
): Standard information.40
(verbose
): Detailed information.48
(debug
): Stuff which is only useful for libav* developers.56
(trace
): Extremely verbose debugging, useful for libav* development.