o
    *‘i&  ã                   @   sà   d Z ddlmZmZ ddlZejjdefdd„ƒZejjdefdd	„ƒZ	ejjd
efdd„ƒZ
ejjdefdd„ƒZejjdeeef fdd„ƒZejjdee fdd„ƒZejjdee fdd„ƒZejjdefdd„ƒZdS )z¦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`.
é    )ÚDictÚListNÚseedc                 C   ó   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)Ú
torchaudioÚlibÚ_torchaudio_soxÚset_seed)r   © r
   úi/var/www/html/eduruby.in/lip-sync/lip-sync-env/lib/python3.10/site-packages/torchaudio/utils/sox_utils.pyr	   
   ó   
r	   Ú	verbosityc                 C   r   )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   Úset_verbosity)r   r
   r
   r   r      s   r   Úbuffer_sizec                 C   r   )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   Úset_buffer_size)r   r
   r
   r   r   )   r   r   Úuse_threadsc                 C   r   )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   Úset_use_threads)r   r
   r
   r   r   6   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   Úlist_effectsr
   r
   r
   r   r   D   s   r   c                   C   ó   t jj ¡ S )zoList the supported audio formats for read

    Returns:
        List[str]: List of supported audio formats
    )r   r   r   Úlist_read_formatsr
   r
   r
   r   r   N   ó   r   c                   C   r   )zpList the supported audio formats for write

    Returns:
        List[str]: List of supported audio formats
    )r   r   r   Úlist_write_formatsr
   r
   r
   r   r   X   r   r   c                   C   r   )zxGet buffer size for sox effect chain

    Returns:
        int: size in bytes of buffers used for processing audio.
    )r   r   r   Úget_buffer_sizer
   r
   r
   r   r   b   r   r   )Ú__doc__Útypingr   r   r   Ú
_extensionZfail_if_no_soxÚintr	   r   r   Úboolr   Ústrr   r   r   r   r
   r
   r
   r   Ú<module>   s&    			