a
    ¬º”hà  ã                   @   sÖ   d Z ddlmZmZ ddlZej ¡ Zddlm	Z	 e	e
dœdd„ƒZe	e
dœd	d
„ƒZe	e
dœdd„ƒZe	edœdd„ƒZe	eeef dœdd„ƒZe	ee dœdd„ƒZe	ee dœdd„ƒZe	e
dœdd„ƒZdS )aB  Module to change the configuration of libsox, which is used by I/O functions like
:py:mod:`~torchaudio.backend.sox_io_backend` and :py:mod:`~torchaudio.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.
é    )ÚDictÚListN)Údropping_support©Úseedc                 C   s   t  | ¡ dS )z’Set libsox's PRNG

    Args:
        seed (int): seed value. valid range is int32.

    See Also:
        http://sox.sourceforge.net/sox.html
    N)Úsox_extÚset_seedr   © r	   úH/var/www/auris/lib/python3.9/site-packages/torchaudio/utils/sox_utils.pyr      s    
r   ©Ú	verbosityc                 C   s   t  | ¡ dS )aD  Set libsox's verbosity

    Args:
        verbosity (int): Set verbosity level of libsox.

            * ``1`` failure messages
            * ``2`` warnings
            * ``3`` details of processing
            * ``4``-``6`` increasing levels of debug messages

    See Also:
        http://sox.sourceforge.net/sox.html
    N)r   Úset_verbosityr   r	   r	   r
   r   $   s    r   ©Úbuffer_sizec                 C   s   t  | ¡ dS )zÊSet buffer size for sox effect chain

    Args:
        buffer_size (int): Set the size in bytes of the buffers used for processing audio.

    See Also:
        http://sox.sourceforge.net/sox.html
    N)r   Úset_buffer_sizer   r	   r	   r
   r   6   s    
r   ©Zuse_threadsc                 C   s   t  | ¡ dS )a>  Set multithread option for sox effect chain

    Args:
        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.

    See Also:
        http://sox.sourceforge.net/sox.html
    N)r   Úset_use_threadsr   r	   r	   r
   r   C   s    r   )Úreturnc                   C   s   t t ¡ ƒS )zxList the available sox effect names

    Returns:
        Dict[str, str]: Mapping from ``effect name`` to ``usage``
    )Údictr   Úlist_effectsr	   r	   r	   r
   r   Q   s    r   c                   C   s   t  ¡ S )zoList the supported audio formats for read

    Returns:
        List[str]: List of supported audio formats
    )r   Úlist_read_formatsr	   r	   r	   r
   r   [   s    r   c                   C   s   t  ¡ S )zpList the supported audio formats for write

    Returns:
        List[str]: List of supported audio formats
    )r   Úlist_write_formatsr	   r	   r	   r
   r   e   s    r   c                   C   s   t  ¡ S )zxGet buffer size for sox effect chain

    Returns:
        int: size in bytes of buffers used for processing audio.
    )r   Úget_buffer_sizer	   r	   r	   r
   r   o   s    r   )Ú__doc__Útypingr   r   Z
torchaudioZ
_extensionZlazy_import_sox_extr   Z!torchaudio._internal.module_utilsr   Úintr   r   r   Úboolr   Ústrr   r   r   r   r	   r	   r	   r
   Ú<module>   s(   
			