U
    %‰dW
  ã                   @   sè   d dl mZmZ d dl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 )é    )ÚDictÚListN)Úmodule_utils©Úseedc                 C   s   t jj | ¡ 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)ÚtorchÚopsÚ
torchaudioZsox_utils_set_seedr   © r
   ú>/tmp/pip-unpacked-wheel-lbdmvq91/torchaudio/utils/sox_utils.pyÚset_seed   s    
r   ©Ú	verbosityc                 C   s   t jj | ¡ 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   r   r	   Zsox_utils_set_verbosityr   r
   r
   r   Úset_verbosity   s    r   ©Úbuffer_sizec                 C   s   t jj | ¡ 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   r   r	   Zsox_utils_set_buffer_sizer   r
   r
   r   Úset_buffer_size&   s    
r   ©Zuse_threadsc                 C   s   t jj | ¡ 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   r   r	   Zsox_utils_set_use_threadsr   r
   r
   r   Úset_use_threads3   s    r   )Úreturnc                   C   s   t tjj ¡ ƒS )zxList the available sox effect names

    Returns:
        Dict[str, str]: Mapping from ``effect name`` to ``usage``
    )Údictr   r   r	   Zsox_utils_list_effectsr
   r
   r
   r   Úlist_effectsA   s    r   c                   C   s   t jj ¡ S )zoList the supported audio formats for read

    Returns:
        List[str]: List of supported audio formats
    )r   r   r	   Zsox_utils_list_read_formatsr
   r
   r
   r   Úlist_read_formatsK   s    r   c                   C   s   t jj ¡ S )zpList the supported audio formats for write

    Returns:
        List[str]: List of supported audio formats
    )r   r   r	   Zsox_utils_list_write_formatsr
   r
   r
   r   Úlist_write_formatsU   s    r   c                   C   s   t jj ¡ S )zxGet buffer size for sox effect chain

    Returns:
        int: size in bytes of buffers used for processing audio.
    )r   r   r	   Zsox_utils_get_buffer_sizer
   r
   r
   r   Úget_buffer_size_   s    r   )Útypingr   r   r   Ztorchaudio._internalr   Z
_mod_utilsZrequires_soxÚintr   r   r   Úboolr   Ústrr   r   r   r   r
   r
   r
   r   Ú<module>   s$   			