o
    i                     @   s`   d Z ddlmZ ddlmZmZ ddlmZ dd Zdd Z	d	d
 Z
g ZdddZdddZdS )z-Multi-library, cross-platform audio decoding.   )ffdec)DecodeErrorNoBackendError)	AudioFilec               	   C   st   zddl } W n
 ty   Y dS w z| dd W n ttfy%   Y dS w z	ddlm} W dS  ty9   Y dS w )zSDetermine whether Gstreamer and the Python GObject bindings are
    installed.
        NFGstz1.0)r   T)giImportErrorZrequire_version
ValueErrorAttributeErrorZgi.repositoryr   )r   r    r   a/var/www/html/eduruby.in/lip-sync/lip-sync-env/lib/python3.10/site-packages/audioread/__init__.py_gst_available   s    r   c                  C   s   ddl } | jd}|duS )zUDetermines whether CoreAudio is available (i.e., we're running on
    Mac OS X).
    r   NZAudioToolbox)Zctypes.utilutilZfind_library)ctypeslibr   r   r   _ca_available,   s   r   c                  C   s$   zddl } W dS  ty   Y dS w )z4Determines whether the pymad bindings are available.r   NFT)madr	   )r   r   r   r   _mad_available5   s   
r   Fc                 C   s   t r| st S ddlm} |jg}t rddlm} ||j t r.ddlm	} ||j
 t r=ddlm} ||j t rG|tj |t dd< t S )a   Returns a list of backends that are available on this system.

    The list of backends is cached after the first call.
    If the parameter `flush_cache` is set to `True`, then the cache
    will be flushed and the backend list will be reconstructed.
    r   )rawread)macca)gstdec)maddecN)BACKENDS r   ZRawAudioFiler   r   appendZExtAudioFiler   r   ZGstAudioFiler   r   ZMadAudioFiler   	availableZFFmpegAudioFile)Zflush_cacher   resultr   r   r   r   r   r   available_backendsC   s"   r   Nc              	   C   s>   |du rt  }|D ]}z|| W   S  ty   Y q	w t )a$  Open an audio file using a library that is available on this
    system.

    The optional `backends` parameter can be a list of audio file
    classes to try opening the file with. If it is not provided,
    `audio_open` tries all available backends. If you call this function
    many times, you can avoid the cost of checking for available
    backends every time by calling `available_backends` once and passing
    the result to each `audio_open` call.

    If all backends fail to read the file, a NoBackendError exception is
    raised.
    N)r   r   r   )pathbackendsZBackendClassr   r   r   
audio_openk   s   r!   )F)N)__doc__r   r   
exceptionsr   r   baser   r   r   r   r   r   r!   r   r   r   r   <module>   s   	
(