目录

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.

torchaudio.utils.sox_utils.set_verbosity(verbosity: int)[source]

Set libsox’s verbosity

Parameters

verbosity (int) –

Set verbosity level of libsox.

  • 1 failure messages

  • 2 warnings

  • 3 details of processing

  • 4-6 increasing levels of debug messages

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.

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.

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]

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.sox_utils.list_write_formats()List[str][source]

List the supported audio formats for write

Returns

List of supported audio formats

Return type

List[str]

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

文档

访问 PyTorch 的全面开发人员文档

查看文档

教程

获取面向初学者和高级开发人员的深入教程

查看教程

资源

查找开发资源并解答您的问题

查看资源