
    tKg                     b    d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	 d Z
d Zd Zg Zdd	ZddZy
)z-Multi-library, cross-platform audio decoding.   )ffdec)DecodeErrorNoBackendError)version)	AudioFilec                      	 ddl } 	 | j                  dd       	 ddlm} y# t        $ r Y yw xY w# t        t        f$ r Y yw xY w# t        $ r Y yw xY w)zSDetermine whether Gstreamer and the Python GObject bindings are
    installed.
        NFGstz1.0)r
   T)giImportErrorrequire_version
ValueErrorAttributeErrorgi.repositoryr
   )r   r
   s     V/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/audioread/__init__.py_gst_availabler      sk    
5%(%   
 ' 
  s,   ! 0 A 	--AA	AAc                  H    ddl } | j                  j                  d      }|duS )zUDetermines whether CoreAudio is available (i.e., we're running on
    Mac OS X).
    r	   NAudioToolbox)ctypes.utilutilfind_library)ctypeslibs     r   _ca_availabler   -   s%     
++
"
">
2Cd?    c                  ,    	 ddl } y# t        $ r Y yw xY w)z4Determines whether the pymad bindings are available.r	   NTF)madr   )r   s    r   _mad_availabler   6   s#       s    	c                    t         r| st         S ddlm} |j                  g}t	               r!ddlm} |j                  |j                         t               r!ddlm	} |j                  |j                         t               r!ddlm} |j                  |j                         t        j                         r|j                  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    RawAudioFiler   r!   appendExtAudioFiler   r"   GstAudioFiler   r#   MadAudioFiler   	availableFFmpegAudioFile)flush_cacher    resultr!   r"   r#   s         r   available_backendsr/   D   s      ""#F e(() f))* f))* e++, HQKOr   Nc                 n    |
t               }|D ]  }	  ||       c S  t               # t        $ r Y $w xY w)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.
    )r/   r   r   )pathbackendsBackendClasss      r   
audio_openr4   l   sK     %' 	%% ! 
	  		s   (	44)F)N)__doc__r%   r   
exceptionsr   r   r   __version__baser   r   r   r   r$   r/   r4    r   r   <module>r:      s7    4  3 + , %Pr   