Ë
    °ëjTí  ã                   ó¢  — d Z dZddlZddlZddlmZmZmZ ddl	m
Z ddlmZ 	 eZddd	d
dddddddœ
Zi dd“dd“dd“dd“dd“dd“dd“d d!“d"d#“d$d%“d&d'“d(d)“d*d+“d,d-“d.d/“d0d1“d2d3“d4d5d6d7d8d9d:d;d<d=œ	¥Zi d>d“d?d“d@d	“dAd
“dBd“dCd“dDd“dEd“dFdG“dHdI“dJdK“dLdM“dNdO“dPdQ“dRdS“dTdU“dVdW“i dXdY“dZd[“d\d]“d^d_“d`da“dbdc“ddde“dfdg“dhdi“djdk“dldm“dndo“dpdq“drds“dtdu“dvdw“dxdy“¥Zddzd{d|d}œZi dd?“dd?“dd?“dd?“dd?“dd?“d d?“d"d?“d$d?“d&dD“d(dD“d*d?“d,df“d.d?“d0d?“d2d?“d~d?“d?d?d?dFdhd?d?dxdœ¥Zd€d�d‚dƒd„œZ	 ej2                  d…k(  rdd†lmZ d‡ e«       z   dˆz   ZnQej2                  d‰k(  rddŠlmZ d‡ e«       d   z   d‹z   Zn+ej2                  dŒk(  rdd†lmZ d‡ e«       z   d�z   Zn edŽ«      ‚ddl Z ejB                  jE                  e jF                  «      Z$ejB                  jK                  e$e«      Z& ejN                  e&«      Z( ej^                  e(ja                  «       «      jc                  d—d˜«      Z2e2jg                  d™«      re2 e4d™«      d Z2	 	 	 d¶dš„Z5	 	 d·d›„Z6	 	 	 	 d¸dœ„Z7 G d�„ dže8«      Z9d¹dŸ„Z:d „ Z;dºd¡„Z<d»d¢„Z=d£„ Z> G d¤„ d¥e8«      Z?d¼d¦„Z@d§„ ZAd¨„ ZBd©„ ZCdª„ ZDd«„ ZEe(jŒ                  fd¬„ZGd­„ ZHd®„ ZId¯„ ZJ G d°„ d±eK«      ZL G d²„ d³eLeM«      ZN G d´„ dµeN«      ZOy# e$ r eZY �Œ³w xY w# ee)e*f$ ré 	  ed�«      Z+e+€ ed�«      ‚ ejN                  e+«      Z(n¿# e$ r· ej2                  d…k(  rd‘Z,n%ej2                  d‰k(  rd’Z,nej2                  dŒk(  rd“Z,n‚ dd†lmZ ej2                  d…k(  rV e«       d”k(  rLejB                  j[                  d•«      rd•nd–Z. ejN                  ejB                  jK                  e.e,«      «      Z(n ejN                  e,«      Z(Y nw xY wY �ŒÕw xY w)½ak  python-soundfile is an audio library based on libsndfile, CFFI and NumPy.

Sound files can be read or written directly using the functions
`read()` and `write()`.
To read a sound file in a block-wise fashion, use `blocks()`.
Alternatively, sound files can be opened as `SoundFile` objects.

For further information, see https://python-soundfile.readthedocs.io/.

z0.12.1é    N)ÚSEEK_SETÚSEEK_CURÚSEEK_END)Úfind_library)Úffié   é   é   é   é   é   é   é   é	   é   )
ÚtitleÚ	copyrightÚsoftwareÚartistÚcommentÚdateÚalbumÚlicenseÚtracknumberÚgenreÚWAVi   ÚAIFFi   ÚAUi   ÚRAWi   ÚPAFi   ÚSVXi   ÚNISTi   ÚVOCi   ÚIRCAMi  
 ÚW64i   ÚMAT4i   ÚMAT5i   ÚPVFi   ÚXIi   ÚHTKi   ÚSDSi   ÚAVRi   i   i   i   i   i   i    i  ! i  " i  # )	ÚWAVEXÚSD2ÚFLACÚCAFÚWVEÚOGGÚMPC2KÚRF64ÚMP3ÚPCM_S8ÚPCM_16ÚPCM_24ÚPCM_32ÚPCM_U8ÚFLOATÚDOUBLEÚULAWÚALAWé   Ú	IMA_ADPCMé   ÚMS_ADPCMé   ÚGSM610é    Ú	VOX_ADPCMé!   ÚNMS_ADPCM_16é"   ÚNMS_ADPCM_24é#   ÚNMS_ADPCM_32é$   ÚG721_32é0   ÚG723_24é1   ÚG723_40é2   ÚDWVW_12é@   ÚDWVW_16éA   ÚDWVW_24éB   ÚDWVW_NéC   ÚDPCM_8éP   ÚDPCM_16éQ   ÚVORBISé`   ÚOPUSéd   ÚALAC_16ép   ÚALAC_20éq   ÚALAC_24ér   ÚALAC_32és   ÚMPEG_LAYER_Ié€   ÚMPEG_LAYER_IIé�   ÚMPEG_LAYER_IIIé‚   i   i    i   0)ÚFILEÚLITTLEÚBIGÚCPUr-   )r.   r/   r0   r1   r2   r3   r4   r5   ÚdoubleÚfloatÚintÚshort)Úfloat64Úfloat32Úint32Úint16Údarwin)ÚmachineÚlibsndfile_z.dylibÚwin32)Úarchitecturez.dllÚlinuxz.soz%no packaged library for this platformÚsndfilez8sndfile library not found using ctypes.util.find_libraryzlibsndfile.dylibzlibsndfile.dllzlibsndfile.soÚarm64z/opt/homebrew/lib/z/usr/local/lib/úutf-8Úreplacezlibsndfile-c           
      ó¼   — t        | d||	|||
|«      5 }|j                  |||«      }|j                  |||||«      }ddd«       j                  fS # 1 sw Y   ŒxY w)a  Provide audio data from a sound file as NumPy array.

    By default, the whole file is read from the beginning, but the
    position to start reading can be specified with *start* and the
    number of frames to read can be specified with *frames*.
    Alternatively, a range can be specified with *start* and *stop*.

    If there is less data left in the file than requested, the rest of
    the frames are filled with *fill_value*.
    If no *fill_value* is specified, a smaller array is returned.

    Parameters
    ----------
    file : str or int or file-like object
        The file to read from.  See `SoundFile` for details.
    frames : int, optional
        The number of frames to read. If *frames* is negative, the whole
        rest of the file is read.  Not allowed if *stop* is given.
    start : int, optional
        Where to start reading.  A negative value counts from the end.
    stop : int, optional
        The index after the last frame to be read.  A negative value
        counts from the end.  Not allowed if *frames* is given.
    dtype : {'float64', 'float32', 'int32', 'int16'}, optional
        Data type of the returned array, by default ``'float64'``.
        Floating point audio data is typically in the range from
        ``-1.0`` to ``1.0``.  Integer data is in the range from
        ``-2**15`` to ``2**15-1`` for ``'int16'`` and from ``-2**31`` to
        ``2**31-1`` for ``'int32'``.

        .. note:: Reading int values from a float file will *not*
            scale the data to [-1.0, 1.0). If the file contains
            ``np.array([42.6], dtype='float32')``, you will read
            ``np.array([43], dtype='int32')`` for ``dtype='int32'``.

    Returns
    -------
    audiodata : `numpy.ndarray` or type(out)
        A two-dimensional (frames x channels) NumPy array is returned.
        If the sound file has only one channel, a one-dimensional array
        is returned.  Use ``always_2d=True`` to return a two-dimensional
        array anyway.

        If *out* was specified, it is returned.  If *out* has more
        frames than available in the file (or if *frames* is smaller
        than the length of *out*) and no *fill_value* is given, then
        only a part of *out* is overwritten and a view containing all
        valid frames is returned.
    samplerate : int
        The sample rate of the audio file.

    Other Parameters
    ----------------
    always_2d : bool, optional
        By default, reading a mono sound file will return a
        one-dimensional array.  With ``always_2d=True``, audio data is
        always returned as a two-dimensional array, even if the audio
        file has only one channel.
    fill_value : float, optional
        If more frames are requested than available in the file, the
        rest of the output is be filled with *fill_value*.  If
        *fill_value* is not specified, a smaller array is returned.
    out : `numpy.ndarray` or subclass, optional
        If *out* is specified, the data is written into the given array
        instead of creating a new array.  In this case, the arguments
        *dtype* and *always_2d* are silently ignored!  If *frames* is
        not given, it is obtained from the length of *out*.
    samplerate, channels, format, subtype, endian, closefd
        See `SoundFile`.

    Examples
    --------
    >>> import soundfile as sf
    >>> data, samplerate = sf.read('stereo_file.wav')
    >>> data
    array([[ 0.71329652,  0.06294799],
           [-0.26450912, -0.38874483],
           ...
           [ 0.67398441, -0.11516333]])
    >>> samplerate
    44100

    ÚrN)Ú	SoundFileÚ_prepare_readÚreadÚ
samplerate)ÚfileÚframesÚstartÚstopÚdtypeÚ	always_2dÚ
fill_valueÚoutr�   ÚchannelsÚformatÚsubtypeÚendianÚclosefdÚfÚdatas                   úV/home/oem/CyberBrain26-unified/dev-env/.venv/lib/python3.12/site-packages/soundfile.pyrŒ   rŒ   Ç   ss   € ôl 
�4˜˜j¨(Ø˜F F¨Gó
5ð AØ89Ø—‘ ¨¨fÓ5ˆØ�v‰v�f˜e Y°
¸CÓ@ˆ÷Að �—‘ÐÐ÷	Að Aús   “)AÁAc           
      óà   — ddl }|j                  |«      }|j                  dk(  rd}n|j                  d   }t	        | d||||||«      5 }	|	j                  |«       ddd«       y# 1 sw Y   yxY w)aú  Write data to a sound file.

    .. note:: If *file* exists, it will be truncated and overwritten!

    Parameters
    ----------
    file : str or int or file-like object
        The file to write to.  See `SoundFile` for details.
    data : array_like
        The data to write.  Usually two-dimensional (frames x channels),
        but one-dimensional *data* can be used for mono files.
        Only the data types ``'float64'``, ``'float32'``, ``'int32'``
        and ``'int16'`` are supported.

        .. note:: The data type of *data* does **not** select the data
                  type of the written file. Audio data will be
                  converted to the given *subtype*. Writing int values
                  to a float file will *not* scale the values to
                  [-1.0, 1.0). If you write the value ``np.array([42],
                  dtype='int32')``, to a ``subtype='FLOAT'`` file, the
                  file will then contain ``np.array([42.],
                  dtype='float32')``.

    samplerate : int
        The sample rate of the audio data.
    subtype : str, optional
        See `default_subtype()` for the default value and
        `available_subtypes()` for all possible values.

    Other Parameters
    ----------------
    format, endian, closefd
        See `SoundFile`.

    Examples
    --------
    Write 10 frames of random data to a new file:

    >>> import numpy as np
    >>> import soundfile as sf
    >>> sf.write('stereo_file.wav', np.random.randn(10, 2), 44100, 'PCM_24')

    r   Nr   Úw)ÚnumpyÚasarrayÚndimÚshaperŠ   Úwrite)
rŽ   rœ   r�   r˜   r™   r—   rš   Únpr–   r›   s
             r�   r¤   r¤   $  so   € óZ Ø�:‰:�dÓ€DØ‡y�y�A‚~Ø‰à—:‘:˜a‘=ˆÜ	�4˜˜j¨(Ø˜F F¨Gó
5ð Ø89Ø	�‰�Œ÷÷ ñ ús   Á	A$Á$A-c           
   #   óÂ   K  — t        | d|
|||||«      5 }|j                  |||«      }|j                  |||||||	«      D ]  }|–— Œ 	 ddd«       y# 1 sw Y   yxY w­w)a8  Return a generator for block-wise reading.

    By default, iteration starts at the beginning and stops at the end
    of the file.  Use *start* to start at a later position and *frames*
    or *stop* to stop earlier.

    If you stop iterating over the generator before it's exhausted,
    the sound file is not closed. This is normally not a problem
    because the file is opened in read-only mode. To close the file
    properly, the generator's ``close()`` method can be called.

    Parameters
    ----------
    file : str or int or file-like object
        The file to read from.  See `SoundFile` for details.
    blocksize : int
        The number of frames to read per block.
        Either this or *out* must be given.
    overlap : int, optional
        The number of frames to rewind between each block.

    Yields
    ------
    `numpy.ndarray` or type(out)
        Blocks of audio data.
        If *out* was given, and the requested frames are not an integer
        multiple of the length of *out*, and no *fill_value* was given,
        the last block will be a smaller view into *out*.

    Other Parameters
    ----------------
    frames, start, stop
        See `read()`.
    dtype : {'float64', 'float32', 'int32', 'int16'}, optional
        See `read()`.
    always_2d, fill_value, out
        See `read()`.
    samplerate, channels, format, subtype, endian, closefd
        See `SoundFile`.

    Examples
    --------
    >>> import soundfile as sf
    >>> for block in sf.blocks('stereo_file.wav', blocksize=1024):
    >>>     pass  # do something with 'block'

    r‰   N)rŠ   r‹   Úblocks)rŽ   Ú	blocksizeÚoverlapr�   r�   r‘   r’   r“   r”   r•   r�   r–   r—   r˜   r™   rš   r›   Úblocks                     r�   r§   r§   \  sx   è ø€ ôf 
�4˜˜j¨(Ø˜F F¨Gó
5ð Ø89Ø—‘ ¨¨fÓ5ˆØ—X‘X˜i¨°&Ø# Y°
¸CóAò 	ˆEà‹Kñ	÷÷ ñ üs   ‚A•4AÁ
	AÁAÁAc                   ó,   — e Zd ZdZd„ Zed„ «       Zd„ Zy)Ú_SoundFileInfozInformation about a SoundFilec                 ó  — || _         t        |«      5 }|j                  | _        |j                  | _        |j                  | _        |j
                  | _        t        | j
                  «      |j                  z  | _        |j                  | _        |j                  | _	        |j                  | _
        |j                  | _        |j                  | _        |j                  | _        |j                  | _        d d d «       y # 1 sw Y   y xY w©N)ÚverboserŠ   Únamer�   r–   r�   rw   Údurationr—   r˜   r™   Úformat_infoÚsubtype_infoÚsectionsÚ
extra_info)ÚselfrŽ   r¯   r›   s       r�   Ú__init__z_SoundFileInfo.__init__š  s»   € ØˆŒÜ�t‹_ð 	+ ØŸ™ˆDŒIØŸl™lˆDŒOØŸJ™JˆDŒMØŸ(™(ˆDŒKÜ! $§+¡+Ó.¨q¯|©|Ñ;ˆDŒMØŸ(™(ˆDŒKØŸ9™9ˆDŒLØŸ(™(ˆDŒKØ Ÿ}™}ˆDÔØ !§¡ˆDÔØŸJ™JˆDŒMØŸl™lˆDŒO÷	+÷ 	+ñ 	+ús   “C#C?Ã?Dc                 ó"  — t        | j                  d«      \  }}t        |d«      \  }}|dk\  rdj                  |||«      }|S |dk\  rdj                  ||«      }|S |dk  rdj                  | j                  «      }|S dj                  |«      }|S )Ni  é<   r   z{0:.0g}:{1:02.0g}:{2:05.3f} hz{0:02.0g}:{1:05.3f} minz{0:d} samplesz	{0:.3f} s)Údivmodr±   r—   r�   )r¶   ÚhoursÚrestÚminutesÚsecondsr±   s         r�   Ú_duration_strz_SoundFileInfo._duration_strª  s¦   € ä˜TŸ]™]¨DÓ1‰ˆˆtÜ! $¨Ó+Ñˆ�Ø�AŠ:Ø6×=Ñ=¸eÀWÈgÓVˆHð ˆð ˜Š\Ø0×7Ñ7¸ÀÓIˆHð
 ˆð	 ˜Š\Ø&×-Ñ-¨d¯k©kÓ:ˆHð ˆð #×)Ñ)¨'Ó2ˆHØˆó    c                 óä   — dj                  g d¢«      }| j                  r|dj                  g d¢«      z  }dj                  | j                  j                  d«      «      }|j	                  | |«      S )Nú
)z{0.name}zsamplerate: {0.samplerate} Hzzchannels: {0.channels}zduration: {0._duration_str}z$format: {0.format_info} [{0.format}]z'subtype: {0.subtype_info} [{0.subtype}])z
endian: {0.endian}zsections: {0.sections}zframes: {0.frames}zextra_info: """z
    {1}"""z
    )Újoinr¯   rµ   Úsplitr—   )r¶   ÚinfoÚindented_extra_infos      r�   Ú__repr__z_SoundFileInfo.__repr__¸  sl   € Ø�y‰yò8ó9ˆð �<Š<Ø�D—I‘Iòó ñ  ˆDð  *×/Ñ/°·±×0EÑ0EÀdÓ0KÓLÐØ�{‰{˜4Ð!4Ó5Ð5rÀ   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r·   Úpropertyr¿   rÇ   © rÀ   r�   r¬   r¬   —  s#   „ Ù'ò+ð  ñó ðó6rÀ   r¬   c                 ó   — t        | |«      S )zŸReturns an object with information about a `SoundFile`.

    Parameters
    ----------
    verbose : bool
        Whether to print additional information.
    )r¬   )rŽ   r¯   s     r�   rÅ   rÅ   Ë  s   € ô ˜$ Ó(Ð(rÀ   c                  ód   — t        t        t        j                  t        j                  «      «      S )a©  Return a dictionary of available major formats.

    Examples
    --------
    >>> import soundfile as sf
    >>> sf.available_formats()
    {'FLAC': 'FLAC (FLAC Lossless Audio Codec)',
     'OGG': 'OGG (OGG Container format)',
     'WAV': 'WAV (Microsoft)',
     'AIFF': 'AIFF (Apple/SGI)',
     ...
     'WAVEX': 'WAVEX (Microsoft)',
     'RAW': 'RAW (header-less)',
     'MAT5': 'MAT5 (GNU Octave 2.1 / Matlab 5.0)'}

    )ÚdictÚ_available_formats_helperÚ_sndÚSFC_GET_FORMAT_MAJOR_COUNTÚSFC_GET_FORMAT_MAJORrÍ   rÀ   r�   Úavailable_formatsrÕ   Ö  s-   € ô" Ô)¬$×*IÑ*IÜ*.×*CÑ*CóEó Fð FrÀ   c                 ó|   ‡ — t        t        j                  t        j                  «      }t	        ˆ fd„|D «       «      S )ad  Return a dictionary of available subtypes.

    Parameters
    ----------
    format : str
        If given, only compatible subtypes are returned.

    Examples
    --------
    >>> import soundfile as sf
    >>> sf.available_subtypes('FLAC')
    {'PCM_24': 'Signed 24 bit PCM',
     'PCM_16': 'Signed 16 bit PCM',
     'PCM_S8': 'Signed 8 bit PCM'}

    c              3   óH   •K  — | ]  \  }}‰�t        ‰|«      r||f–— Œ y ­wr®   )Úcheck_format)Ú.0r˜   r°   r—   s      €r�   ú	<genexpr>z%available_subtypes.<locals>.<genexpr>þ  s0   øè ø€ ò D¡M G¨TØ�>¤\°&¸'Ô%Bð ˜$”ñ Dùs   ƒ")rÑ   rÒ   ÚSFC_GET_FORMAT_SUBTYPE_COUNTÚSFC_GET_FORMAT_SUBTYPErÐ   )r—   Úsubtypess   ` r�   Úavailable_subtypesrÞ   ë  s>   ø€ ô" )¬×)JÑ)JÜ)-×)DÑ)DóF€Häó D°Xô Dó Dð DrÀ   c                 óZ   — 	 t        t        | ||«      «      S # t        t        f$ r Y yw xY w)záCheck if the combination of format/subtype/endian is valid.

    Examples
    --------
    >>> import soundfile as sf
    >>> sf.check_format('WAV', 'PCM_24')
    True
    >>> sf.check_format('FLAC', 'VORBIS')
    False

    F)ÚboolÚ_format_intÚ
ValueErrorÚ	TypeError)r—   r˜   r™   s      r�   rØ   rØ     s2   € ðÜ”K ¨°Ó8Ó9Ð9øÜœ	Ð"ò Ùðús   ‚ ˜*©*c                 ó^   — t        | «       t        j                  | j                  «       «      S )zÍReturn the default subtype for a given format.

    Examples
    --------
    >>> import soundfile as sf
    >>> sf.default_subtype('WAV')
    'PCM_16'
    >>> sf.default_subtype('MAT5')
    'DOUBLE'

    )Ú_check_formatÚ_default_subtypesÚgetÚupper©r—   s    r�   Údefault_subtyperê     s#   € ô �&ÔÜ× Ñ  §¡£Ó0Ð0rÀ   c                   ó  — e Zd ZdZ	 	 d4d„Z ed„ «      Z	  ed„ «      Z	  ed„ «      Z	  ed„ «      Z		  ed„ «      Z
	  ed	„ «      Z	  ed
„ «      Z	  ed„ «      Z	  ed„ «      Z	  ed„ «      Z	  ed„ «      Z	  ed„ «      Z	  ed„ «      Z	 ed„ «       ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zefd„Z d„ Z!	 	 d5d„Z"d6d„Z#d „ Z$d!„ Z%d"„ Z&	 	 d7d#„Z'd8d$„Z(d%„ Z)d&„ Z*d'„ Z+d(„ Z,d)„ Z-d*„ Z.d+„ Z/d,„ Z0d-„ Z1d.„ Z2d/„ Z3d0„ Z4d1„ Z5d2„ Z6d3„ Z7y)9rŠ   z­A sound file.

    For more documentation see the __init__() docstring (which is also
    used for the online documentation (https://python-soundfile.readthedocs.io/).

    Nc	           	      óú  — t        |d«      r|j                  «       n|}|| _        |€t        |dd«      }t	        |«      }	|| _        t        |||||||«      | _        | j                  ||	|«      | _	        t        |«      j                  d«      r!| j                  «       r| j                  d«       t        j                  | j                  t        j                   t"        j$                  t        j&                  «       y)a{  Open a sound file.

        If a file is opened with `mode` ``'r'`` (the default) or
        ``'r+'``, no sample rate, channels or file format need to be
        given because the information is obtained from the file. An
        exception is the ``'RAW'`` data format, which always requires
        these data points.

        File formats consist of three case-insensitive strings:

        * a *major format* which is by default obtained from the
          extension of the file name (if known) and which can be
          forced with the format argument (e.g. ``format='WAVEX'``).
        * a *subtype*, e.g. ``'PCM_24'``. Most major formats have a
          default subtype which is used if no subtype is specified.
        * an *endian-ness*, which doesn't have to be specified at all in
          most cases.

        A `SoundFile` object is a *context manager*, which means
        if used in a "with" statement, `close()` is automatically
        called when reaching the end of the code block inside the "with"
        statement.

        Parameters
        ----------
        file : str or int or file-like object
            The file to open.  This can be a file name, a file
            descriptor or a Python file object (or a similar object with
            the methods ``read()``/``readinto()``, ``write()``,
            ``seek()`` and ``tell()``).
        mode : {'r', 'r+', 'w', 'w+', 'x', 'x+'}, optional
            Open mode.  Has to begin with one of these three characters:
            ``'r'`` for reading, ``'w'`` for writing (truncates *file*)
            or ``'x'`` for writing (raises an error if *file* already
            exists).  Additionally, it may contain ``'+'`` to open
            *file* for both reading and writing.
            The character ``'b'`` for *binary mode* is implied because
            all sound files have to be opened in this mode.
            If *file* is a file descriptor or a file-like object,
            ``'w'`` doesn't truncate and ``'x'`` doesn't raise an error.
        samplerate : int
            The sample rate of the file.  If `mode` contains ``'r'``,
            this is obtained from the file (except for ``'RAW'`` files).
        channels : int
            The number of channels of the file.
            If `mode` contains ``'r'``, this is obtained from the file
            (except for ``'RAW'`` files).
        subtype : str, sometimes optional
            The subtype of the sound file.  If `mode` contains ``'r'``,
            this is obtained from the file (except for ``'RAW'``
            files), if not, the default value depends on the selected
            `format` (see `default_subtype()`).
            See `available_subtypes()` for all possible subtypes for
            a given `format`.
        endian : {'FILE', 'LITTLE', 'BIG', 'CPU'}, sometimes optional
            The endian-ness of the sound file.  If `mode` contains
            ``'r'``, this is obtained from the file (except for
            ``'RAW'`` files), if not, the default value is ``'FILE'``,
            which is correct in most cases.
        format : str, sometimes optional
            The major format of the sound file.  If `mode` contains
            ``'r'``, this is obtained from the file (except for
            ``'RAW'`` files), if not, the default value is determined
            from the file extension.  See `available_formats()` for
            all possible values.
        closefd : bool, optional
            Whether to close the file descriptor on `close()`. Only
            applicable if the *file* argument is a file descriptor.

        Examples
        --------
        >>> from soundfile import SoundFile

        Open an existing file for reading:

        >>> myfile = SoundFile('existing_file.wav')
        >>> # do something with myfile
        >>> myfile.close()

        Create a new sound file for reading and writing using a with
        statement:

        >>> with SoundFile('new_file.wav', 'x+', 44100, 2) as myfile:
        >>>     # do something with myfile
        >>>     # ...
        >>>     assert not myfile.closed
        >>>     # myfile.close() is called automatically at the end
        >>> assert myfile.closed

        Ú
__fspath__NÚmodezr+r   )Úhasattrrí   Ú_nameÚgetattrÚ_check_modeÚ_modeÚ_create_info_structÚ_infoÚ_openÚ_fileÚsetÚ
issupersetÚseekableÚseekrÒ   Ú
sf_commandÚSFC_SET_CLIPPINGÚ_ffiÚNULLÚSF_TRUE)
r¶   rŽ   rî   r�   r–   r˜   r™   r—   rš   Úmode_ints
             r�   r·   zSoundFile.__init__,  sÃ   € ô| %,¨D°,Ô$?ˆt�‰Ô ÀTˆØˆŒ
Øˆ<Ü˜4 ¨Ó.ˆDÜ˜tÓ$ˆØˆŒ
Ü(¨¨t°ZÀØ)/°¸&óBˆŒ
à—Z‘Z  h°Ó8ˆŒ
Üˆt‹9×Ñ Ô%¨$¯-©-¬/à�I‰I�aŒLÜ�‰˜Ÿ
™
¤D×$9Ñ$9¼4¿9¹9ÜŸ™õ	&rÀ   c                 ó   — | j                   S r®   )rð   ©r¶   s    r�   ú<lambda>zSoundFile.<lambda>™  ó
   €  §¡€ rÀ   c                 ó   — | j                   S r®   )ró   r  s    r�   r  zSoundFile.<lambda>›  r  rÀ   c                 ó.   — | j                   j                  S r®   )rõ   r�   r  s    r�   r  zSoundFile.<lambda>�  s   €  t§z¡z×'<Ñ'<€ rÀ   c                 ó.   — | j                   j                  S r®   ©rõ   r�   r  s    r�   r  zSoundFile.<lambda>Ÿ  s   €  4§:¡:×#4Ñ#4€ rÀ   c                 ó.   — | j                   j                  S r®   )rõ   r–   r  s    r�   r  zSoundFile.<lambda>¡  ó   €  T§Z¡Z×%8Ñ%8€ rÀ   c                 ób   — t        | j                  j                  t        j                  z  «      S r®   )Ú_format_strrõ   r—   rÒ   ÚSF_FORMAT_TYPEMASKr  s    r�   r  zSoundFile.<lambda>¤  s    € ”[ §¡×!2Ñ!2´T×5LÑ5LÑ!LÓM€ rÀ   c                 ób   — t        | j                  j                  t        j                  z  «      S r®   )r  rõ   r—   rÒ   ÚSF_FORMAT_SUBMASKr  s    r�   r  zSoundFile.<lambda>§  ó    € ”[ §¡×!2Ñ!2´T×5KÑ5KÑ!KÓL€ rÀ   c                 ób   — t        | j                  j                  t        j                  z  «      S r®   )r  rõ   r—   rÒ   ÚSF_FORMAT_ENDMASKr  s    r�   r  zSoundFile.<lambda>ª  r  rÀ   c                 óh   — t        | j                  j                  t        j                  z  «      d   S ©Nr   )Ú_format_inforõ   r—   rÒ   r  r  s    r�   r  zSoundFile.<lambda>­  s-   € ”\ $§*¡*×"3Ñ"3Ü"&×"9Ñ"9ñ#:ó ;Ø;<ñ>€ rÀ   c                 óh   — t        | j                  j                  t        j                  z  «      d   S r  )r  rõ   r—   rÒ   r  r  s    r�   r  zSoundFile.<lambda>±  s-   € ”\ $§*¡*×"3Ñ"3Ü"&×"8Ñ"8ñ#9ó :Ø:;ñ=€ rÀ   c                 ó.   — | j                   j                  S r®   )rõ   r´   r  s    r�   r  zSoundFile.<lambda>´  r  rÀ   c                 ó   — | j                   d u S r®   )r÷   r  s    r�   r  zSoundFile.<lambda>¶  s   €  4§:¡:°Ð#5€ rÀ   c                 ó@   — t         j                  | j                  «      S r®   )rÒ   Úsf_errorr÷   r  s    r�   r  zSoundFile.<lambda>¸  s   € ¤t§}¡}°T·Z±ZÓ'@€ rÀ   c                 óþ   — t        j                  dd«      }t        j                  | j                  t        j
                  |t        j                  |«      «       t        j                  |«      j                  dd«      S )z8Retrieve the log string generated when opening the file.zchar[]i @  r†   r‡   )	rþ   ÚnewrÒ   rü   r÷   ÚSFC_GET_LOG_INFOÚsizeofÚstringÚdecode)r¶   rÅ   s     r�   rµ   zSoundFile.extra_info»  sX   € ô �x‰x˜ %Ó(ˆÜ�‰˜Ÿ
™
¤D×$9Ñ$9ØœdŸk™k¨$Ó/ô	1ä�{‰{˜4Ó ×'Ñ'¨°Ó;Ð;rÀ   c                 ó$   — dj                  | «      S )Nz™SoundFile({0.name!r}, mode={0.mode!r}, samplerate={0.samplerate}, channels={0.channels}, format={0.format!r}, subtype={0.subtype!r}, endian={0.endian!r})ré   r  s    r�   rÇ   zSoundFile.__repr__Æ  s   € ð'÷ (.¡v¨d£|ð	5rÀ   c                 ó$   — | j                  «        y r®   ©Úcloser  s    r�   Ú__del__zSoundFile.__del__Ì  ó   € Ø�
‰
�rÀ   c                 ó   — | S r®   rÍ   r  s    r�   Ú	__enter__zSoundFile.__enter__Ï  s   € ØˆrÀ   c                 ó$   — | j                  «        y r®   r$  )r¶   Úargss     r�   Ú__exit__zSoundFile.__exit__Ò  r'  rÀ   c                 óæ   — |t         v rR| j                  «        t        j                  | j                  t         |   |j                  «       «      }t        |«       yt        j                  | ||«       y)z:Write text meta-data in the sound file through properties.N)	Ú
_str_typesÚ_check_if_closedrÒ   Úsf_set_stringr÷   ÚencodeÚ_error_checkÚobjectÚ__setattr__)r¶   r°   ÚvalueÚerrs       r�   r4  zSoundFile.__setattr__Õ  sV   € à”:ÑØ×!Ñ!Ô#Ü×$Ñ$ T§Z¡Z´¸DÑ1AØ%*§\¡\£^ó5ˆCä˜Õä×Ñ˜t T¨5Õ1rÀ   c                 ó  — |t         v r`| j                  «        t        j                  | j                  t         |   «      }|r%t        j                  |«      j                  dd«      S dS t        dj                  |«      «      ‚)z9Read text meta-data in the sound file through properties.r†   r‡   Ú z)'SoundFile' object has no attribute {0!r})
r.  r/  rÒ   Úsf_get_stringr÷   rþ   r   r!  ÚAttributeErrorr—   )r¶   r°   rœ   s      r�   Ú__getattr__zSoundFile.__getattr__ß  sq   € à”:ÑØ×!Ñ!Ô#Ü×%Ñ% d§j¡j´*¸TÑ2BÓCˆDÙCG”4—;‘;˜tÓ$×+Ñ+¨G°YÓ?ÐOÈRÐOä Ø;×BÑBÀ4ÓHóJð JrÀ   c                 ó.   — | j                   j                  S r®   r	  r  s    r�   Ú__len__zSoundFile.__len__é  s   € ð �z‰z× Ñ Ð rÀ   c                  ó   — y)NTrÍ   r  s    r�   Ú__bool__zSoundFile.__bool__î  s   € ð rÀ   c                 ó"   — | j                  «       S r®   )r?  r  s    r�   Ú__nonzero__zSoundFile.__nonzero__ó  s   € ð �}‰}‹ÐrÀ   c                 óP   — | j                   j                  t        j                  k(  S )z)Return True if the file supports seeking.)rõ   rú   rÒ   r   r  s    r�   rú   zSoundFile.seekableø  s   € à�z‰z×"Ñ"¤d§l¡lÑ2Ð2rÀ   c                 ó’   — | j                  «        t        j                  | j                  ||«      }t	        | j
                  «       |S )aÜ  Set the read/write position.

        Parameters
        ----------
        frames : int
            The frame index or offset to seek.
        whence : {SEEK_SET, SEEK_CUR, SEEK_END}, optional
            By default (``whence=SEEK_SET``), *frames* are counted from
            the beginning of the file.
            ``whence=SEEK_CUR`` seeks from the current position
            (positive and negative values are allowed for *frames*).
            ``whence=SEEK_END`` seeks from the end (use negative value
            for *frames*).

        Returns
        -------
        int
            The new absolute read/write position in frames.

        Examples
        --------
        >>> from soundfile import SoundFile, SEEK_END
        >>> myfile = SoundFile('stereo_file.wav')

        Seek to the beginning of the file:

        >>> myfile.seek(0)
        0

        Seek to the end of the file:

        >>> myfile.seek(0, SEEK_END)
        44100  # this is the file length

        )r/  rÒ   Úsf_seekr÷   r2  Ú
_errorcode)r¶   r�   ÚwhenceÚpositions       r�   rû   zSoundFile.seekü  s8   € ðH 	×ÑÔÜ—<‘< §
¡
¨F°FÓ;ˆÜ�T—_‘_Ô%ØˆrÀ   c                 ó.   — | j                  dt        «      S )z'Return the current read/write position.r   )rû   r   r  s    r�   ÚtellzSoundFile.tell%  s   € à�y‰y˜œHÓ%Ð%rÀ   c                 óð   — |€&| j                  ||«      }| j                  |||«      }n|dk  s|t        |«      kD  rt        |«      }| j                  d||«      }t        |«      |kD  r|€|d| }|S |||d |S )a  Read from the file and return data as NumPy array.

        Reads the given number of frames in the given data format
        starting at the current read/write position.  This advances the
        read/write position by the same number of frames.
        By default, all frames from the current read/write position to
        the end of the file are returned.
        Use `seek()` to move the current read/write position.

        Parameters
        ----------
        frames : int, optional
            The number of frames to read. If ``frames < 0``, the whole
            rest of the file is read.
        dtype : {'float64', 'float32', 'int32', 'int16'}, optional
            Data type of the returned array, by default ``'float64'``.
            Floating point audio data is typically in the range from
            ``-1.0`` to ``1.0``. Integer data is in the range from
            ``-2**15`` to ``2**15-1`` for ``'int16'`` and from
            ``-2**31`` to ``2**31-1`` for ``'int32'``.

            .. note:: Reading int values from a float file will *not*
                scale the data to [-1.0, 1.0). If the file contains
                ``np.array([42.6], dtype='float32')``, you will read
                ``np.array([43], dtype='int32')`` for
                ``dtype='int32'``.

        Returns
        -------
        audiodata : `numpy.ndarray` or type(out)
            A two-dimensional NumPy (frames x channels) array is
            returned. If the sound file has only one channel, a
            one-dimensional array is returned. Use ``always_2d=True``
            to return a two-dimensional array anyway.

            If *out* was specified, it is returned. If *out* has more
            frames than available in the file (or if *frames* is
            smaller than the length of *out*) and no *fill_value* is
            given, then only a part of *out* is overwritten and a view
            containing all valid frames is returned.

        Other Parameters
        ----------------
        always_2d : bool, optional
            By default, reading a mono sound file will return a
            one-dimensional array. With ``always_2d=True``, audio data
            is always returned as a two-dimensional array, even if the
            audio file has only one channel.
        fill_value : float, optional
            If more frames are requested than available in the file,
            the rest of the output is be filled with *fill_value*. If
            *fill_value* is not specified, a smaller array is
            returned.
        out : `numpy.ndarray` or subclass, optional
            If *out* is specified, the data is written into the given
            array instead of creating a new array. In this case, the
            arguments *dtype* and *always_2d* are silently ignored! If
            *frames* is not given, it is obtained from the length of
            *out*.

        Examples
        --------
        >>> from soundfile import SoundFile
        >>> myfile = SoundFile('stereo_file.wav')

        Reading 3 frames from a stereo file:

        >>> myfile.read(3)
        array([[ 0.71329652,  0.06294799],
               [-0.26450912, -0.38874483],
               [ 0.67398441, -0.11516333]])
        >>> myfile.close()

        See Also
        --------
        buffer_read, .write

        Nr   rŒ   )Ú_check_framesÚ_create_empty_arrayÚlenÚ	_array_io)r¶   r�   r’   r“   r”   r•   s         r�   rŒ   zSoundFile.read)  s“   € ð` ˆ;Ø×'Ñ'¨°
Ó;ˆFØ×*Ñ*¨6°9¸eÓD‰Cà˜Šz˜V¤c¨#£hÒ.Ü˜S›�Ø—‘ ¨¨VÓ4ˆÜˆs‹8�fÒØÐ!Ø˜'˜6�l�ð ˆ
ð  *��F�G�Øˆ
rÀ   c                 óö   — | j                  |d¬«      }| j                  |«      }t        j                  |dz   || j                  z  «      }| j                  d|||«      }||k(  sJ ‚t        j                  |«      S )a‘  Read from the file and return data as buffer object.

        Reads the given number of *frames* in the given data format
        starting at the current read/write position.  This advances the
        read/write position by the same number of frames.
        By default, all frames from the current read/write position to
        the end of the file are returned.
        Use `seek()` to move the current read/write position.

        Parameters
        ----------
        frames : int, optional
            The number of frames to read. If ``frames < 0``, the whole
            rest of the file is read.
        dtype : {'float64', 'float32', 'int32', 'int16'}
            Audio data will be converted to the given data type.

        Returns
        -------
        buffer
            A buffer containing the read data.

        See Also
        --------
        buffer_read_into, .read, buffer_write

        N)r”   z[]rŒ   )rK  Ú_check_dtyperþ   r  r–   Ú	_cdata_ioÚbuffer)r¶   r�   r’   ÚctypeÚcdataÚread_framess         r�   Úbuffer_readzSoundFile.buffer_read‡  sw   € ð8 ×#Ñ# F°tÐ#Ó<ˆØ×!Ñ! %Ó(ˆÜ—‘˜ ™ v°·±Ñ'=Ó>ˆØ—n‘n V¨U°E¸6ÓBˆØ˜fÒ$Ð$Ð$Ü�{‰{˜5Ó!Ð!rÀ   c                 óz   — | j                  |«      }| j                  ||«      \  }}| j                  d|||«      }|S )a�  Read from the file into a given buffer object.

        Fills the given *buffer* with frames in the given data format
        starting at the current read/write position (which can be
        changed with `seek()`) until the buffer is full or the end
        of the file is reached.  This advances the read/write position
        by the number of frames that were read.

        Parameters
        ----------
        buffer : writable buffer
            Audio frames from the file are written to this buffer.
        dtype : {'float64', 'float32', 'int32', 'int16'}
            The data type of *buffer*.

        Returns
        -------
        int
            The number of frames that were read from the file.
            This can be less than the size of *buffer*.
            The rest of the buffer is not filled with meaningful data.

        See Also
        --------
        buffer_read, .read

        rŒ   )rP  Ú_check_bufferrQ  )r¶   rR  r’   rS  rT  r�   s         r�   Úbuffer_read_intozSoundFile.buffer_read_intoª  sC   € ð8 ×!Ñ! %Ó(ˆØ×*Ñ*¨6°5Ó9‰ˆˆvØ—‘ ¨¨u°fÓ=ˆØˆrÀ   c                 ó¨   — ddl }|j                  |«      }| j                  d|t        |«      «      }|t        |«      k(  sJ ‚| j	                  |«       y)aø  Write audio data from a NumPy array to the file.

        Writes a number of frames at the read/write position to the
        file. This also advances the read/write position by the same
        number of frames and enlarges the file if necessary.

        Note that writing int values to a float file will *not* scale
        the values to [-1.0, 1.0). If you write the value
        ``np.array([42], dtype='int32')``, to a ``subtype='FLOAT'``
        file, the file will then contain ``np.array([42.],
        dtype='float32')``.

        Parameters
        ----------
        data : array_like
            The data to write. Usually two-dimensional (frames x
            channels), but one-dimensional *data* can be used for mono
            files. Only the data types ``'float64'``, ``'float32'``,
            ``'int32'`` and ``'int16'`` are supported.

            .. note:: The data type of *data* does **not** select the
                  data type of the written file. Audio data will be
                  converted to the given *subtype*. Writing int values
                  to a float file will *not* scale the values to
                  [-1.0, 1.0). If you write the value ``np.array([42],
                  dtype='int32')``, to a ``subtype='FLOAT'`` file, the
                  file will then contain ``np.array([42.],
                  dtype='float32')``.

        Examples
        --------
        >>> import numpy as np
        >>> from soundfile import SoundFile
        >>> myfile = SoundFile('stereo_file.wav')

        Write 10 frames of random data to a new file:

        >>> with SoundFile('stereo_file.wav', 'w', 44100, 2, 'PCM_24') as f:
        >>>     f.write(np.random.randn(10, 2))

        See Also
        --------
        buffer_write, .read

        r   Nr¤   )r    ÚascontiguousarrayrN  rM  Ú_update_frames)r¶   rœ   r¥   Úwrittens       r�   r¤   zSoundFile.writeË  sN   € ó\ 	à×#Ñ# DÓ)ˆØ—.‘. ¨$´°D³	Ó:ˆØœ#˜d›)Ò#Ð#Ð#Ø×Ñ˜GÕ$rÀ   c                 ó¨   — | j                  |«      }| j                  ||«      \  }}| j                  d|||«      }||k(  sJ ‚| j                  |«       y)a€  Write audio data from a buffer/bytes object to the file.

        Writes the contents of *data* to the file at the current
        read/write position.
        This also advances the read/write position by the number of
        frames that were written and enlarges the file if necessary.

        Parameters
        ----------
        data : buffer or bytes
            A buffer or bytes object containing the audio data to be
            written.
        dtype : {'float64', 'float32', 'int32', 'int16'}
            The data type of the audio data stored in *data*.

        See Also
        --------
        .write, buffer_read

        r¤   N)rP  rX  rQ  r\  )r¶   rœ   r’   rS  rT  r�   r]  s          r�   Úbuffer_writezSoundFile.buffer_write   sZ   € ð* ×!Ñ! %Ó(ˆØ×*Ñ*¨4°Ó7‰ˆˆvØ—.‘. ¨%°¸Ó?ˆØ˜&Ò Ð Ð Ø×Ñ˜GÕ$rÀ   c           	   #   ó@  K  — ddl }d| j                  vrd| j                  vrt        d«      ‚|€#|€t        d«      ‚| j	                  |||«      }d}	n|�t        d«      ‚t        |«      }d	}	d}
| j                  ||«      }|dkD  r—|
€d}nt        |
«      }|
|d| t        ||z
  |«      }| j                  ||||||d «       |r!|
€|j                  || d «      }
n	|| d |
dd |||z   kD  r|€	|d||z    }n|}|	r|j                  |«      n|–— ||z  }|dkD  rŒ–yy­w)
aÆ  Return a generator for block-wise reading.

        By default, the generator yields blocks of the given
        *blocksize* (using a given *overlap*) until the end of the file
        is reached; *frames* can be used to stop earlier.

        Parameters
        ----------
        blocksize : int
            The number of frames to read per block. Either this or *out*
            must be given.
        overlap : int, optional
            The number of frames to rewind between each block.
        frames : int, optional
            The number of frames to read.
            If ``frames < 0``, the file is read until the end.
        dtype : {'float64', 'float32', 'int32', 'int16'}, optional
            See `read()`.

        Yields
        ------
        `numpy.ndarray` or type(out)
            Blocks of audio data.
            If *out* was given, and the requested frames are not an
            integer multiple of the length of *out*, and no
            *fill_value* was given, the last block will be a smaller
            view into *out*.


        Other Parameters
        ----------------
        always_2d, fill_value, out
            See `read()`.
        fill_value : float, optional
            See `read()`.
        out : `numpy.ndarray` or subclass, optional
            If *out* is specified, the data is written into the given
            array instead of creating a new array. In this case, the
            arguments *dtype* and *always_2d* are silently ignored!

        Examples
        --------
        >>> from soundfile import SoundFile
        >>> with SoundFile('stereo_file.wav') as f:
        >>>     for block in f.blocks(blocksize=1024):
        >>>         pass  # do something with 'block'

        r   Nr‰   ú+z*blocks() is not allowed in write-only modez)One of {blocksize, out} must be specifiedTz-Only one of {blocksize, out} may be specifiedF)
r    rî   ÚSoundFileRuntimeErrorrã   rL  rM  rK  ÚminrŒ   Úcopy)r¶   r¨   r©   r�   r’   r“   r”   r•   r¥   Úcopy_outÚoverlap_memoryÚoutput_offsetÚtoreadrª   s                 r�   r§   zSoundFile.blocks  so  è ø€ ód 	à�d—i‘iÑ C¨t¯y©yÑ$8Ü'Ð(TÓUÐUàˆ;ØÐ ÜÐ KÓLÐLØ×*Ñ*¨9°iÀÓGˆCØ‰HàÐ$ÜØCóEð Eä˜C›ˆIØˆHàˆØ×#Ñ# F¨JÓ7ˆØ�qŠjØÐ%Ø !‘ä # NÓ 3�Ø&4��N�]Ð#ä˜ ]Ñ2°FÓ;ˆFØ�I‰I�f˜e Y°
¸CÀÀÐ<OÔPáØ!Ð)Ø%'§W¡W¨S°'°°¨^Ó%<‘Nà(+¨W¨H¨I¨�N¡1Ð%à˜6 GÑ+Ò+°
Ð0BØÐ-˜V gÑ-Ð.‘à�Ù$,�"—'‘'˜%”.°%Ò7Ø�fÑˆFð+ �q�jùs   ‚DDÄDc                 óR  — |€| j                  «       }t        j                  | j                  t        j                  t        j                  d|«      t        j                  d«      «      }|r+t        j                  | j                  «      }t        |d«      ‚|| j                  _        y)an  Truncate the file to a given number of frames.

        After this command, the read/write position will be at the new
        end of the file.

        Parameters
        ----------
        frames : int, optional
            Only the data before *frames* is kept, the rest is deleted.
            If not specified, the current read/write position is used.

        Nzsf_count_t*Ú
sf_count_tzError truncating the file)rI  rÒ   rü   r÷   ÚSFC_FILE_TRUNCATErþ   r  r  r  ÚLibsndfileErrorrõ   r�   )r¶   r�   r6  s      r�   ÚtruncatezSoundFile.truncatew  s{   € ð ˆ>Ø—Y‘Y“[ˆFÜ�o‰o˜dŸj™j¬$×*@Ñ*@Ü"Ÿh™h }°fÓ=Ü"Ÿk™k¨,Ó7ó9ˆñ ä—-‘- §
¡
Ó+ˆCÜ! #Ð'BÓCÐCØ"ˆ�
‰
ÕrÀ   c                 ób   — | j                  «        t        j                  | j                  «       y)aj  Write unwritten data to the file system.

        Data written with `write()` is not immediately written to
        the file system but buffered in memory to be written at a later
        time.  Calling `flush()` makes sure that all changes are
        actually written to the file system.

        This has no effect on files opened in read-only mode.

        N)r/  rÒ   Úsf_write_syncr÷   r  s    r�   ÚflushzSoundFile.flush�  s"   € ð 	×ÑÔÜ×Ñ˜4Ÿ:™:Õ&rÀ   c                 ó    — | j                   sB| j                  «        t        j                  | j                  «      }d| _        t        |«       yy)z.Close the file.  Can be called multiple times.N)Úclosedrp  rÒ   Úsf_closer÷   r2  )r¶   r6  s     r�   r%  zSoundFile.close�  s8   € à�{Š{à�J‰JŒLÜ—-‘- §
¡
Ó+ˆCØˆDŒJÜ˜Õð rÀ   c                 óÐ  — t        |t        t        f«      �r9t        j                  j                  |«      ržd| j                  v r$t        dj                  | j                  «      «      ‚t        | j                  «      j                  d«      rHt        j                  t        j                  |t        j                  t        j                  z  «      «       t         j"                  }t        |t        «      rGt$        j&                  dk(  rt         j(                  }n#|j+                  t%        j,                  «       «      } |||| j.                  «      }n£t        |t0        «      r#t         j3                  ||| j.                  |«      }npt5        ||«      r@t         j7                  | j9                  |«      || j.                  t:        j<                  «      }n$t?        dj                  | j                  «      «      ‚|t:        j<                  k(  r;t         jA                  |«      }tC        |dj                  | j                  «      ¬«      ‚|t         jD                  k(  rd| j.                  _#        |S )	z9Call the appropriate sf_open*() function from libsndfile.ÚxzFile exists: {0!r}zw+r�   zInvalid file: {0!r}zError opening {0!r}: ©Úprefixr   )$Ú
isinstanceÚ_unicodeÚbytesÚ_osÚpathÚisfilerî   ÚOSErrorr—   r°   rø   rù   r%  ÚopenÚO_WRONLYÚO_TRUNCrÒ   Úsf_openÚ_sysÚplatformÚsf_wchar_openr1  Úgetfilesystemencodingrõ   rx   Ú
sf_open_fdÚ_has_virtual_io_attrsÚsf_open_virtualÚ_init_virtual_iorþ   rÿ   rã   r  rl  Ú	SFM_WRITEr�   )r¶   rŽ   r  rš   ÚopenfunctionÚfile_ptrr6  s          r�   rö   zSoundFile._open¦  s£  € ä�dœX¤uÐ-Õ.Ü�x‰x�‰˜tÔ$Ø˜$Ÿ)™)Ñ#Ü!Ð"6×"=Ñ"=¸d¿i¹iÓ"HÓIÐIÜ˜Ÿ™“^×.Ñ.¨tÔ4ä—I‘IœcŸh™h t¬S¯\©\¼C¿K¹KÑ-GÓHÔIÜŸ<™<ˆLÜ˜$¤Ô)Ü—=‘= GÒ+Ü#'×#5Ñ#5‘LàŸ;™;¤t×'AÑ'AÓ'CÓD�DÙ# D¨(°D·J±JÓ?‰HÜ˜œcÔ"Ü—‘ t¨X°t·z±zÀ7ÓK‰HÜ" 4¨Ô2Ü×+Ñ+¨D×,AÑ,AÀ$Ó,GØ,4°d·j±jÄ$Ç)Á)óM‰Hô Ð1×8Ñ8¸¿¹ÓCÓDÐDØ”t—y‘yÒ ä—-‘- Ó)ˆCÜ! #Ð.E×.LÑ.LÈTÏYÉYÓ.WÔXÐXØ”t—~‘~Ò%ð !"ˆD�J‰JÔð ˆrÀ   c                 ó€  ‡— t        j                  d«      ˆfd„«       }t        j                  d«      ˆfd„«       }t        j                  d«      ˆfd„«       }t        j                  d«      ˆfd„«       }t        j                  d	«      ˆfd
„«       }|||||dœ| _        t        j                  d| j                  «      S )z4Initialize callback functions for sf_open_virtual().Úsf_vio_get_filelenc                 ó    •— ‰j                  «       }‰j                  dt        «       ‰j                  «       }‰j                  |t        «       |S ©Nr   )rI  rû   r   r   )Ú	user_dataÚcurrÚsizerŽ   s      €r�   Úvio_get_filelenz3SoundFile._init_virtual_io.<locals>.vio_get_filelenÌ  s:   ø€ à—9‘9“;ˆDØ�I‰I�aœÔ"Ø—9‘9“;ˆDØ�I‰I�dœHÔ%ØˆKrÀ   Úsf_vio_seekc                 óH   •— ‰j                  | |«       ‰j                  «       S r®   )rû   rI  )ÚoffsetrF  r’  rŽ   s      €r�   Úvio_seekz,SoundFile._init_virtual_io.<locals>.vio_seekÔ  s   ø€ à�I‰I�f˜fÔ%Ø—9‘9“;ÐrÀ   Úsf_vio_readc                 óæ   •— 	 t        j                  | |«      }‰j                  |«      }|S # t        $ r; ‰j	                  |«      }t        |«      }t        j                  | |«      }||d| Y |S w xY wr‘  )rþ   rR  Úreadintor:  rŒ   rM  )ÚptrÚcountr’  ÚbufÚ	data_readrœ   rŽ   s         €r�   Úvio_readz,SoundFile._init_virtual_io.<locals>.vio_readÙ  sx   ø€ ð(Ü—k‘k # uÓ-�Ø ŸM™M¨#Ó.�	ð Ðøô "ò (Ø—y‘y Ó'�Ü ›I�	Ü—k‘k # yÓ1�Ø#'��A�iÑ ØÐð(ús   ƒ', ¬A A0Á/A0Úsf_vio_writec                 óh   •— t        j                  | |«      }|d d  }‰j                  |«      }|€|}|S r®   )rþ   rR  r¤   )r�  rž  r’  rŸ  rœ   r]  rŽ   s         €r�   Ú	vio_writez-SoundFile._init_virtual_io.<locals>.vio_writeæ  s9   ø€ ä—+‘+˜c 5Ó)ˆCØ‘q�6ˆDØ—j‘j Ó&ˆGàˆØ�ØˆNrÀ   Úsf_vio_tellc                 ó$   •— ‰j                  «       S r®   )rI  )r’  rŽ   s    €r�   Úvio_tellz,SoundFile._init_virtual_io.<locals>.vio_tellð  s   ø€ à—9‘9“;ÐrÀ   )Úget_filelenrû   rŒ   r¤   rI  zSF_VIRTUAL_IO*)rþ   ÚcallbackÚ_virtual_ior  )r¶   rŽ   r•  r™  r¡  r¤  r§  s    `     r�   rŠ  zSoundFile._init_virtual_ioÊ  sÈ   ø€ ä	�‰Ð+Ó	,ó	ó 
-ð	ô 
�‰�}Ó	%ó	ó 
&ð	ô 
�‰�}Ó	%ó
	ó 
&ð
	ô 
�‰�~Ó	&ó	ó 
'ð	ô 
�‰�}Ó	%ó	ó 
&ð	ð ,;Ø$,Ø$,Ø%.Ø$,ñ	.ˆÔô �x‰xÐ(¨$×*:Ñ*:Ó;Ð;rÀ   c                 ó   — t         S )z€Return all attributes used in __setattr__ and __getattr__.

        This is useful for auto-completion (e.g. IPython).

        )r.  r  s    r�   Ú_getAttributeNameszSoundFile._getAttributeNamesý  s
   € ô ÐrÀ   c                 ó2   — | j                   rt        d«      ‚y)z…Check if the file is closed and raise an error if it is.

        This should be used in every method that uses self._file.

        zI/O operation on closed fileN)rr  rb  r  s    r�   r/  zSoundFile._check_if_closed  s   € ð �;Š;Ü'Ð(FÓGÐGð rÀ   c                 ó    — | j                  «       r-| j                  | j                  «       z
  }|dk  s||kD  r|€|}|S |dk  rt        d«      ‚|S )z8Reduce frames to no more than are available in the file.r   z/frames must be specified for non-seekable files)rú   r�   rI  râ   )r¶   r�   r”   Úremaining_framess       r�   rK  zSoundFile._check_frames  s[   € à�=‰=Œ?Ø#Ÿ{™{¨T¯Y©Y«[Ñ8ÐØ˜Šz˜fÐ'7Ò7Ø(Ð0Ø)�ð ˆð �aŠZÜÐNÓOÐOØˆrÀ   c                 ó  — |t         j                  «       v sJ ‚t        |t        «      st	        j
                  |«      }t        t        |«      | j                  t	        j                  |«      z  «      \  }}|rt        d«      ‚||fS )z1Convert buffer to cdata and check for valid size.z*Data size must be a multiple of frame size)Ú
_ffi_typesÚvaluesrx  rz  rþ   Úfrom_bufferrº   rM  r–   r  râ   )r¶   rœ   rS  r�   Ú	remainders        r�   rX  zSoundFile._check_buffer  sw   € àœ
×)Ñ)Ó+Ñ+Ð+Ð+Ü˜$¤Ô&Ü×#Ñ# DÓ)ˆDÜ"¤3 t£9Ø#'§=¡=´4·;±;¸uÓ3EÑ#EóGÑˆ�	áÜÐIÓJÐJØ�Vˆ|ÐrÀ   c                 óx   — ddl }|s| j                  dkD  r|| j                  f}n|f}|j                  ||d¬«      S )z-Create an empty array with appropriate shape.r   Nr   ÚC)Úorder)r    r–   Úempty)r¶   r�   r“   r’   r¥   r£   s         r�   rL  zSoundFile._create_empty_array$  s=   € ãÙ˜Ÿ™¨Ò)Ø˜DŸM™MÐ)‰Eà�GˆEØ�x‰x˜˜u¨CˆxÓ0Ð0rÀ   c           	      óœ   — 	 t         |   S # t        $ r7 t        dj                  t	        t         j                  «       «      |«      «      ‚w xY w)z7Check if dtype string is valid and return ctype string.z(dtype must be one of {0!r} and not {1!r})r±  ÚKeyErrorrâ   r—   ÚsortedÚkeys)r¶   r’   s     r�   rP  zSoundFile._check_dtype-  sM   € ð	3Ü˜eÑ$Ð$øÜò 	3ÜÐG×NÑNÜ”z—‘Ó(Ó)¨5ó2ó 3ð 3ð	3ús
   ‚ ‹A Ac                 óZ  — |j                   dvsI|j                   dk(  r| j                  dk7  s+|j                   dk(  r@|j                  d   | j                  k7  r$t        dj	                  |j                  «      «      ‚|j
                  j                  st        d«      ‚| j                  |j                  j                  «      }|j                  j                  t        j                  |«      k(  sJ ‚t        j                  |dz   |j                  d   d   «      }| j                  ||||«      S )	z+Check array and call low-level IO function.)r   r	   r   r	   zInvalid shape: {0!r}zData must be C-contiguousÚ*rœ   r   )r¢   r–   r£   râ   r—   ÚflagsÚc_contiguousrP  r’   r°   Úitemsizerþ   r  ÚcastÚ__array_interface__rQ  )r¶   ÚactionÚarrayr�   rS  rT  s         r�   rN  zSoundFile._array_io5  sê   € à�J‰J˜fÑ$Ø—
‘
˜a’ D§M¡M°QÒ$6Ø—
‘
˜a’ E§K¡K°¡N°d·m±mÒ$CÜÐ3×:Ñ:¸5¿;¹;ÓGÓHÐHØ�{‰{×'Ò'ÜÐ8Ó9Ð9Ø×!Ñ! %§+¡+×"2Ñ"2Ó3ˆØ�{‰{×#Ñ#¤t§{¡{°5Ó'9Ò9Ð9Ð9Ü—	‘	˜% #™+ u×'@Ñ'@ÀÑ'HÈÑ'KÓLˆØ�~‰~˜f e¨U°FÓ;Ð;rÀ   c                 ól  — |t         j                  «       v sJ ‚| j                  «        | j                  «       r| j	                  «       }t        t        d|z   dz   |z   «      } || j                  ||«      }t        | j                  «       | j                  «       r| j                  |z   t        «       |S )z.Call one of libsndfile's read/write functions.Úsf_Úf_)r±  r²  r/  rú   rI  rñ   rÒ   r÷   r2  rE  rû   r   )r¶   rÄ  rœ   rS  r�   r“  Úfuncs          r�   rQ  zSoundFile._cdata_ioB  s‘   € àœ
×)Ñ)Ó+Ñ+Ð+Ð+Ø×ÑÔØ�=‰=Œ?Ø—9‘9“;ˆDÜ”t˜U V™^¨dÑ2°UÑ:Ó;ˆÙ�d—j‘j $¨Ó/ˆÜ�T—_‘_Ô%Ø�=‰=Œ?Ø�I‰I�d˜V‘m¤XÔ.ØˆrÀ   c                 óú   — | j                  «       rL| j                  «       }| j                  dt        «      | j                  _        | j                  |t        «       y| j                  xj
                  |z  c_        y)z!Update self.frames after writing.r   N)rú   rI  rû   r   rõ   r�   r   )r¶   r]  r“  s      r�   r\  zSoundFile._update_framesO  sP   € à�=‰=Œ?Ø—9‘9“;ˆDØ $§	¡	¨!¬XÓ 6ˆD�J‰JÔØ�I‰I�dœHÕ%à�J‰J×Ò Ñ(ÖrÀ   c                 ó*  — |dk7  r| j                  «       st        d«      ‚|dk\  r|�t        d«      ‚t        ||«      j	                  | j
                  «      \  }}}||k  r|}|dk  r||z
  }| j                  «       r| j                  |t        «       |S )z)Seek to start frame and calculate length.r   z(start is only allowed for seekable filesz&Only one of {frames, stop} may be used)rú   râ   rã   ÚsliceÚindicesr�   rû   r   )r¶   r�   r‘   r�   Ú_s        r�   r‹   zSoundFile._prepare_readX  sŽ   € à�AŠ:˜dŸm™mœoÜÐGÓHÐHØ�QŠ;˜4Ð+ÜÐDÓEÐEä˜u dÓ+×3Ñ3°D·K±KÓ@‰ˆˆt�QØ�%Š<ØˆDØ�AŠ:Ø˜E‘\ˆFØ�=‰=Œ?Ø�I‰I�eœXÔ&ØˆrÀ   c                 óØ   — i }t         j                  «       D ]P  \  }}t        j                  | j                  |«      }|sŒ)t        j                  |«      j                  dd«      ||<   ŒR |S )a5  Get all metadata present in this SoundFile

        Returns
        -------

        metadata: dict[str, str]
            A dict with all metadata. Possible keys are: 'title', 'copyright',
            'software', 'artist', 'comment', 'date', 'album', 'license',
            'tracknumber' and 'genre'.
        r†   r‡   )r.  ÚitemsrÒ   r9  r÷   rþ   r   r!  )r¶   ÚstrsÚstrtypeÚstridrœ   s        r�   Úcopy_metadatazSoundFile.copy_metadatah  sf   € ð ˆÜ(×.Ñ.Ó0ò 	M‰NˆG�UÜ×%Ñ% d§j¡j°%Ó8ˆDÚÜ $§¡¨DÓ 1× 8Ñ 8¸À)Ó L��W’ð	Mð ˆrÀ   )r‰   NNNNNT)éÿÿÿÿrz   FNN)rÕ  N)Nr   rÕ  rz   FNNr®   )8rÈ   rÉ   rÊ   rË   r·   rÌ   r°   rî   r�   r�   r–   r—   r˜   r™   r²   r³   r´   rr  rE  rµ   r÷   rÇ   r&  r)  r,  r4  r;  r=  r?  rA  rú   r   rû   rI  rŒ   rV  rY  r¤   r_  r§   rm  rp  r%  rö   rŠ  r¬  r/  rK  rX  rL  rP  rN  rQ  r\  r‹   rÔ  rÍ   rÀ   r�   rŠ   rŠ   $  sË  „ ñð BFØAEók&ñZ Ñ+Ó,€DØ*ÙÑ+Ó,€DØ7ÙÑ<Ó=€JØ,ÙÑ4Ó5€FØ1ÙÑ8Ó9€HØ3ÙÙMóO€Fà-ÙÙLóN€Gà4ÙÙLóN€Fà8Ùñ	>ó?€Kð ?Ùñ	=ó>€Lð :ÙÑ8Ó9€HØ3ÙÑ5Ó6€FØ2ÙÑ@ÓA€JØ'àñ<ó ð<ð €Eò5òòòò2òJò!ò
ò
ò
3ð #+ó 'òR&ð :?Ø"&ó\ó|!"òFòB3%òj%ð6 BKØ59óZóx#ò0'òò"òH1<òfòHò	ò	ò1ò3ò<òò)òó rÀ   rŠ   c                 ó(   — | dk7  rt        | |¬«      ‚y)z+Raise LibsndfileError if there is an error.r   rv  N)rl  )r6  rw  s     r�   r2  r2  |  s   € à
ˆa‚xÜ˜c¨&Ô1Ð1ð rÀ   c                 óè  — t        | «      }|€'t        | «      }|€Jt        dj                  | «      «      ‚t	        |t
        t        f«      st        dj                  |«      «      ‚	 |t        |j                  «          z  }|€d}n0t	        |t
        t        f«      st        dj                  |«      «      ‚	 |t        |j                  «          z  }t        j                  d«      }||_        d|_        t        j!                  |«      t        j"                  k(  rt        d	«      ‚|S # t        $ r t        dj                  |«      «      ‚w xY w# t        $ r t        dj                  |«      «      ‚w xY w)
z8Return numeric ID for given format|subtype|endian combo.z)No default subtype for major format {0!r}zInvalid subtype: {0!r}zUnknown subtype: {0!r}rr   zInvalid endian-ness: {0!r}zUnknown endian-ness: {0!r}úSF_INFO*r   z1Invalid combination of format, subtype and endian)rå   rê   rã   r—   rx  ry  ÚstrÚ	_subtypesrè   rº  râ   Ú_endiansrþ   r  r–   rÒ   Úsf_format_checkÚSF_FALSE)r—   r˜   r™   ÚresultrÅ   s        r�   rá   rá   ‚  sh  € ä˜6Ó"€FØ€Ü! &Ó)ˆØˆ?ÜØ;×BÑBÀ6ÓJóLð Lä˜¤(¬C Ô1ÜÐ0×7Ñ7¸Ó@ÓAÐAðCØ”)˜GŸM™M›OÑ,Ñ,ˆð €~Ø‰Ü˜¤¬3 Ô0ÜÐ4×;Ñ;¸FÓCÓDÐDðFØ”(˜6Ÿ<™<›>Ñ*Ñ*ˆô �8‰8�JÓ€DØ€D„KØ€D„MÜ×Ñ˜DÓ!¤T§]¡]Ò2ÜØ?óAð 	Aà€Møô# ò CÜÐ1×8Ñ8¸ÓAÓBÐBðCûô ò FÜÐ5×<Ñ<¸VÓDÓEÐEðFús   Á&D& Â6E Ä&$E
Å$E1c                 óÈ  — t        | t        t        f«      st        dj	                  | «      «      ‚t        | «      }|j                  d«      st        | «      t        |«      kD  rt        dj	                  | «      «      ‚t        |j                  d«      «      dk7  rt        d«      ‚d|v rt        j                  }|S d|v rt        j                  }|S t        j                  }|S )z=Check if mode is valid and return its integer representation.zInvalid mode: {0!r}zxrwb+Úxrwr   z&mode must contain exactly one of 'xrw'ra  r‰   )rx  ry  rÙ  rã   r—   rø   Ú
differencerM  râ   ÚintersectionrÒ   ÚSFM_RDWRÚSFM_READr‹  )rî   Úmode_setr  s      r�   rò   rò   ¢  sÈ   € ä�dœX¤s˜OÔ,ÜÐ-×4Ñ4°TÓ:Ó;Ð;Ü�4‹y€HØ×Ñ˜7Ô#¤s¨4£y´3°x³=Ò'@ÜÐ.×5Ñ5°dÓ;Ó<Ð<Ü
ˆ8× Ñ  Ó'Ó(¨AÒ-ÜÐAÓBÐBà
ˆh�Ü—=‘=ˆð
 €Oð	 
�‰Ü—=‘=ˆð €Oô —>‘>ˆØ€OrÀ   c                 ó€  — |}|€$t        | |«      }t        |t        t        f«      sJ ‚t	        |«       t        j                  d«      }d|vs|j                  «       dk(  r<|€t        d«      ‚||_	        |€t        d«      ‚||_
        t        |||«      |_        |S t        d„ |||||fD «       «      rt        d«      ‚|S )z*Check arguments and create SF_INFO struct.rØ  r‰   r   zsamplerate must be specifiedzchannels must be specifiedc              3   ó$   K  — | ]  }|d u–— Œ
 y ­wr®   rÍ   )rÙ   Úargs     r�   rÚ   z&_create_info_struct.<locals>.<genexpr>É  s   è ø€ ò I 3ˆs˜$Œñ Iùs   ‚z\Not allowed for existing files (except 'RAW'): samplerate, channels, format, subtype, endian)Ú_get_format_from_filenamerx  ry  rÙ  rå   rþ   r  rè   rã   r�   r–   rá   r—   Úany)	rŽ   rî   r�   r–   r—   r˜   r™   Úoriginal_formatrÅ   s	            r�   rô   rô   µ  sã   € ð €OØ€~Ü*¨4°Ó6ˆÜ˜&¤8¬S /Ô2Ð2Ð2ä�fÔä�8‰8�JÓ€DØ
�$�˜&Ÿ,™,›.¨EÒ1ØÐÜÐ:Ó;Ð;Ø$ˆŒØÐÜÐ8Ó9Ð9Ø ˆŒÜ! &¨'°6Ó:ˆŒð €Kô	 ñ IØ˜H o°wÀð+Hô Iô Iäð Ló Mð Mà€KrÀ   c                 ó  — d}t        | d| «      } 	 t        j                  j                  | «      d   dd }|j	                  dd«      }|j                  «       t        vrd|vrt        d	j                  | «      «      ‚|S # t
        $ r Y ŒAw xY w)
a  Return a format string obtained from file (or file.name).

    If file already exists (= read mode), an empty string is returned on
    error.  If not, an exception is raised.
    The return type will always be str or unicode (even if
    file/file.name is a bytes object).

    r8  r°   rÕ  r   Nr†   r‡   r‰   zGNo format specified and unable to get format from file extension: {0!r})
rñ   r{  r|  Úsplitextr!  Ú	Exceptionrè   Ú_formatsrã   r—   )rŽ   rî   r—   s      r�   ré  ré  Ð  s–   € ð €FÜ�4˜ Ó&€Dðä—‘×"Ñ" 4Ó(¨Ñ,¨Q¨RÐ0ˆà—‘˜w¨	Ó2ˆð ‡|�|ƒ~œXÑ%¨#°T©/Üð 0ß06±°t³ó>ð 	>à€Møô ò Ùðús   ‘7A> Á>	B
Â	B
c                 óv   — t         t        t        fD ]%  }|j                  «       D ]  \  }}|| k(  sŒ|c c S  Œ' y)z;Return the string representation of a given numeric format.zn/a)rï  rÚ  rÛ  rÐ  )Ú
format_intÚ
dictionaryÚkÚvs       r�   r  r  è  sE   € ä¤	¬8Ð3ò ˆ
Ø×$Ñ$Ó&ò 	‰DˆAˆqØ�J‹Ø”ñ	ðð
 rÀ   c                 óB  — t        j                  d«      }| |_        t        j	                  t         j
                  ||t        j                  d«      «       |j                  }t        |j                  «      |r&t        j                  |«      j                  dd«      fS dfS )z6Return the ID and short description of a given format.zSF_FORMAT_INFO*ÚSF_FORMAT_INFOr†   r‡   r8  )rþ   r  r—   rÒ   rü   rÿ   r  r°   r  r   r!  )rñ  Úformat_flagr²   r°   s       r�   r  r  ò  s‹   € ä—(‘(Ð,Ó-€KØ#€KÔÜ‡O�O”D—I‘I˜{¨KÜ—K‘KÐ 0Ó1ô3à×Ñ€DÜ˜×*Ñ*Ó+Ù<@ŒD�K‰K˜Ó×$Ñ$ W¨iÓ8ðJð JØFHðJð JrÀ   c              #   óê   K  — t        j                  d«      }t        j                  t         j                  | |t        j
                  d«      «       t        |d   «      D ]  }t        ||«      –— Œ y­w)z8Helper for available_formats() and available_subtypes().zint*rx   r   N)rþ   r  rÒ   rü   rÿ   r  Úranger  )Ú
count_flagr÷  rž  rñ  s       r�   rÑ   rÑ   ý  sW   è ø€ ä�H‰H�VÓ€EÜ‡O�O”D—I‘I˜z¨5´$·+±+¸eÓ2DÔEÜ˜E !™H“oò 4ˆ
Ü˜: {Ó3Ó3ñ4ùs   ‚A1A3c                 óä   — t        | t        t        f«      st        dj	                  | «      «      ‚	 t
        | j                  «          }|S # t        $ r t        dj	                  | «      «      ‚w xY w)z4Check if `format_str` is valid and return format ID.zInvalid format: {0!r}zUnknown format: {0!r})	rx  ry  rÙ  rã   r—   rï  rè   rº  râ   )Ú
format_strrñ  s     r�   rå   rå     sr   € ä�j¤8¬S /Ô2ÜÐ/×6Ñ6°zÓBÓCÐCðEÜ˜j×.Ñ.Ó0Ñ1ˆ
ð Ðøô ò EÜÐ0×7Ñ7¸
ÓCÓDÐDðEús   ²A Á$A/c           	      óè   — |t         j                  k(  }|t         j                  k(  }t        t	        | d«      t	        | d«      t	        | d«      xs |t	        | d«      xs t	        | d«      xs |g«      S )z>Check if file has all the necessary attributes for virtual IO.rû   rI  r¤   rŒ   rœ  )rÒ   rä  r‹  Úallrï   )rŽ   r  ÚreadonlyÚ	writeonlys       r�   rˆ  rˆ    sn   € àœ4Ÿ=™=Ñ(€HØœDŸN™NÑ*€IÜÜ��fÓÜ��fÓÜ��gÓÒ* (Ü��fÓÒG¤¨¨zÓ!:ÒG¸ið	ó ð rÀ   c                   ó   — e Zd ZdZy)ÚSoundFileErrorz-Base class for all soundfile-specific errors.N©rÈ   rÉ   rÊ   rË   rÍ   rÀ   r�   r  r    s   „ Ù7ØrÀ   r  c                   ó   — e Zd ZdZy)rb  zKsoundfile module runtime error.

    Errors that used to be `RuntimeError`.Nr  rÍ   rÀ   r�   rb  rb     s   „ ñ.ð 	rÀ   rb  c                   ó.   — e Zd ZdZdd„Zed„ «       Zd„ Zy)rl  zjlibsndfile errors.


    Attributes
    ----------
    code
        libsndfile internal error number.
    c                 óN   — t         j                  | ||«       || _        || _        y r®   )rb  r·   Úcoderw  )r¶   r  rw  s      r�   r·   zLibsndfileError.__init__/  s"   € Ü×&Ñ& t¨T°6Ô:ØˆŒ	Øˆ�rÀ   c                 ó¤   — | j                   rDt        j                  | j                   «      }t        j                  |«      j                  dd«      S y)zRaw libsndfile error message.r†   r‡   z'(Garbled error message from libsndfile))r  rÒ   Úsf_error_numberrþ   r   r!  )r¶   Úerr_strs     r�   Úerror_stringzLibsndfileError.error_string4  s@   € ð �9Š9Ü×*Ñ*¨4¯9©9Ó5ˆGÜ—;‘;˜wÓ'×.Ñ.¨w¸	ÓBÐBð
 =rÀ   c                 ó4   — | j                   | j                  z   S r®   )rw  r  r  s    r�   Ú__str__zLibsndfileError.__str__@  s   € Ø�{‰{˜T×.Ñ.Ñ.Ð.rÀ   N©r8  )rÈ   rÉ   rÊ   rË   r·   rÌ   r  r  rÍ   rÀ   r�   rl  rl  &  s%   „ ñóð
 ñ	=ó ð	=ó/rÀ   rl  )rÕ  r   Nrz   FNNNNNNNT)NNNT)Nr   rÕ  r   Nrz   FNNNNNNNT)Fr®   )NNr  )PrË   Ú__version__Úosr{  Úsysrƒ  r   r   r   Úctypes.utilr   Ú_find_libraryÚ
_soundfiler   rþ   Úunicodery  Ú	NameErrorrÙ  r.  rï  rÚ  rÛ  ræ   r±  r„  r   Ú_machineÚ_packaged_libnamer‚   Ú_architecturer~  Ú_soundfile_datar|  ÚdirnameÚ__file__Ú_pathrÃ   Ú
_full_pathÚdlopenrÒ   ÚImportErrorrã   Ú_libnameÚ_explicit_libnameÚisdirÚ_hbrew_pathr   Úsf_version_stringr!  Ú__libsndfile_version__Ú
startswithrM  rŒ   r¤   r§   r3  r¬   rÅ   rÕ   rÞ   rØ   rê   rŠ   r2  rá   rò   rô   ré  r  ÚSFC_GET_FORMAT_INFOr  rÑ   rå   rˆ  rî  r  ÚRuntimeErrorrb  rl  rÍ   rÀ   r�   ú<module>r*     sì  ðñ	ð €ã Û ß +Ñ +Ý 5Ý "ðØ€Hð ØØØØØØØØØñ€
ðØ	ˆXðà
ˆXðð 	ˆXðð 
ˆXð	ð
 
ˆXðð 
ˆXðð ˆXðð 
ˆXðð ˆXðð 
ˆXðð ˆXðð ˆXðð 
ˆXðð 	ˆXðð 
ˆXðð  
ˆXð!ð" 
ˆXð#ð$ ØØØØØØØØò5€ð:#Ø�fð#à�fð#ð �fð#ð �fð	#ð
 �fð#ð �fð#ð �fð#ð �fð#ð �fð#ð �fð#ð �fð#ð �fð#ð �fð#ð �fð#ð �fð#ð  �fð!#ð" �fñ##ð$ �fð%#ð& �fð'#ð( �fð)#ð* �fð+#ð, �fð-#ð. �fð/#ð0 �fð1#ð2 �fð3#ð4 �fð5#ð6 �fð7#ð8 �fð9#ð: �fð;#ð< �fð=#ð> �fð?#ð@ �fðA#ðB �fðC#ðD �fñE#€	ðL ØØØñ	€ðØ	ˆXðà
ˆXðð 	ˆXðð
 
ˆXðð 
ˆXðð ˆXðð 
ˆXðð ˆXðð 
ˆXðð ˆXðð ˆXðð 
ˆXðð 	ˆYðð 
ˆXðð  
ˆXð!ð" 
ˆXð#ð$ ˆXð%ð& ØØØØØØØò5Ð ð< ØØØñ	€
ð,2Ø‡}�}˜Ò Ý0Ø)©H«JÑ6¸ÑAÑØ	�‰˜'Ò	!Ý:Ø)©M«O¸AÑ,>Ñ>ÀÑGÑØ	�‰˜'Ò	!Ý0Ø)©H«JÑ6¸Ñ>ÑáÐ=Ó>Ð>ãØ�H‰H×Ñ˜_×5Ñ5Ó6€EØ—‘—‘˜uÐ&7Ó8€JØˆ4�;‰;�zÓ"€Dð< %˜Ÿ™ T×%;Ñ%;Ó%=Ó>×EÑEÀgÈyÓYÐ Ø×$Ñ$ ]Ô3Ø3±C¸Ó4FÐ4GÐHÐð JOØ>BØ9=óZðz EIØó5ðp FJØBFØ%)Ø;?ó8ôv16�Vô 16óh)òFó*Dó.ò$1ô T�ô Tóp2òò@ò&ò6ò0ð *.×)AÑ)Aó Jò4òò	ô	�Yô 	ô	˜N¨Lô 	ô/Ð+õ /øðc0 ò ØƒHðûðb 	�˜iÐ(ò 2ð2Ù  Ó+ˆØÐÙÐTÓUÐUØˆt�{‰{˜8Ó$‰øàò 2à�=‰=˜HÒ$Ø 2ÑØ�]‰]˜gÒ%Ø 0ÑØ�]‰]˜gÒ%Ø /Ñàõ 	1Ø�=‰=˜HÒ$©«°wÒ)>Ø25·(±(·.±.ÐAUÔ2VÑ.Ø&ð à�4—;‘;˜sŸx™xŸ}™}¨[Ð:KÓLÓM‰Dà�4—;‘;Ð0Ó1ˆDùð'2ýð2úsI   ¤K Ä-CK ËKËKËOË&$LÌ
OÌB9OÏOÏOÏOÏO