+
        2                        R t RtRtRt^ RIt^ RIt ^ RIHt ]P                  t]P                  t]P                  t]P                  t]P                  t]P                   t]P"                  t]P$                  t]P&                  t]P(                  t]P*                  t]P,                  t]P.                  t]P0                  t]P2                  t]P4                  t]P6                  t]P8                  t]P:                  t]P<                  t]P>                  t]P@                  t ]PB                  t!]PD                  t"]PF                  t#]PH                  t$]PJ                  t%]PL                  t&]PN                  t']PP                  t(]PR                  t)]PT                  t*]PV                  t+]PX                  t,]PZ                  t-]P\                  t.]P^                  t/]P`                  t0]Pb                  t1]Pd                  t2]Pf                  t3]Ph                  t4]Pj                  t5]Pl                  t6]Pn                  t7]Pp                  t8]Pr                  t9]Pt                  t:]Pv                  t;]Px                  t<]Pz                  t=]P|                  t>]P~                  t?]P                  t@]P                  tA]P                  tB]P                  tC]P                  tD]P                  tER tFRR ltGR tHR	 tI ! R
 R4      tJ]K! ]R4      '       d    ! R R]P                  4      tM ! R R]JP                  4      tNR#   ]	 d    ]
! R4       h i ; i)aZ  
PyAudio provides Python bindings for PortAudio, the cross-platform
audio I/O library. With PyAudio, you can easily use Python to play and
record audio on a variety of platforms.

.. include:: ../sphinx/examples.rst

Overview
--------

**Classes**
  :py:class:`PyAudio`, :py:class:`PyAudio.Stream`

.. only:: pamac

   **Host Specific Classes**
     :py:class:`PaMacCoreStreamInfo`

**Stream Conversion Convenience Functions**
  :py:func:`get_sample_size`, :py:func:`get_format_from_width`

**PortAudio version**
  :py:func:`get_portaudio_version`, :py:func:`get_portaudio_version_text`

.. |PaSampleFormat| replace:: :ref:`PortAudio Sample Format <PaSampleFormat>`
.. _PaSampleFormat:

**Portaudio Sample Formats**
  :py:data:`paFloat32`, :py:data:`paInt32`, :py:data:`paInt24`,
  :py:data:`paInt16`, :py:data:`paInt8`, :py:data:`paUInt8`,
  :py:data:`paCustomFormat`

.. |PaHostAPI| replace:: :ref:`PortAudio Host API <PaHostAPI>`
.. _PaHostAPI:

**PortAudio Host APIs**
  :py:data:`paInDevelopment`, :py:data:`paDirectSound`, :py:data:`paMME`,
  :py:data:`paASIO`, :py:data:`paSoundManager`, :py:data:`paCoreAudio`,
  :py:data:`paOSS`, :py:data:`paALSA`, :py:data:`paAL`, :py:data:`paBeOS`,
  :py:data:`paWDMKS`, :py:data:`paJACK`, :py:data:`paWASAPI`,
  :py:data:`paNoDevice`

.. |PaErrorCode| replace:: :ref:`PortAudio Error Code <PaErrorCode>`
.. _PaErrorCode:

**PortAudio Error Codes**
  :py:data:`paNoError`, :py:data:`paNotInitialized`,
  :py:data:`paUnanticipatedHostError`, :py:data:`paInvalidChannelCount`,
  :py:data:`paInvalidSampleRate`, :py:data:`paInvalidDevice`,
  :py:data:`paInvalidFlag`, :py:data:`paSampleFormatNotSupported`,
  :py:data:`paBadIODeviceCombination`, :py:data:`paInsufficientMemory`,
  :py:data:`paBufferTooBig`, :py:data:`paBufferTooSmall`,
  :py:data:`paNullCallback`, :py:data:`paBadStreamPtr`,
  :py:data:`paTimedOut`, :py:data:`paInternalError`,
  :py:data:`paDeviceUnavailable`,
  :py:data:`paIncompatibleHostApiSpecificStreamInfo`,
  :py:data:`paStreamIsStopped`, :py:data:`paStreamIsNotStopped`,
  :py:data:`paInputOverflowed`, :py:data:`paOutputUnderflowed`,
  :py:data:`paHostApiNotFound`, :py:data:`paInvalidHostApi`,
  :py:data:`paCanNotReadFromACallbackStream`,
  :py:data:`paCanNotWriteToACallbackStream`,
  :py:data:`paCanNotReadFromAnOutputOnlyStream`,
  :py:data:`paCanNotWriteToAnInputOnlyStream`,
  :py:data:`paIncompatibleStreamHostApi`

.. |PaCallbackReturnCodes| replace:: :ref:`PortAudio Callback Return Code <PaCallbackReturnCodes>`
.. _PaCallbackReturnCodes:

**PortAudio Callback Return Codes**
  :py:data:`paContinue`, :py:data:`paComplete`, :py:data:`paAbort`

.. |PaCallbackFlags| replace:: :ref:`PortAutio Callback Flag <PaCallbackFlags>`
.. _PaCallbackFlags:

**PortAudio Callback Flags**
  :py:data:`paInputUnderflow`, :py:data:`paInputOverflow`,
  :py:data:`paOutputUnderflow`, :py:data:`paOutputOverflow`,
  :py:data:`paPrimingOutput`
zHubert Phamz0.2.13zrestructuredtext enNz;Could not import the PyAudio C module 'pyaudio._portaudio'.c                .    \         P                  ! V 4      # )zReturns the size (in bytes) for the specified sample *format*.

:param format: A |PaSampleFormat| constant.
:raises ValueError: on invalid specified `format`.
:rtype: integer
paget_sample_size)formats   &7/usr/lib64/python3.14/site-packages/pyaudio/__init__.pyr   r      s     f%%    c                    V ^8X  d   V'       d   \         # \        # V ^8X  d   \        # V ^8X  d   \        # V ^8X  d   \        # \        RV  24      h)a  Returns a PortAudio format constant for the specified *width*.

:param width: The desired sample width in bytes (1, 2, 3, or 4)
:param unsigned: For 1 byte width, specifies signed or unsigned format.

:raises ValueError: when invalid *width*
:rtype: A |PaSampleFormat| constant
zInvalid width: )paUInt8paInt8paInt16paInt24	paFloat32
ValueError)widthunsigneds   &&r   get_format_from_widthr      sO     zNzzz
ug.
//r   c                 ,    \         P                  ! 4       # )z(Returns portaudio version.

:rtype: int
)r   get_version r   r   get_portaudio_versionr      s    
 >>r   c                 ,    \         P                  ! 4       # )z<Returns PortAudio version as a text string.

:rtype: string
)r   get_version_textr   r   r   get_portaudio_version_textr      s    
   r   c                      a  ] tR t^t o Rt ! R R4      tR tR tR tRR lt	R t
R	 tR
 tR tR tR tR tR tR tR tRR ltR tR tR tR tRtV tR# )PyAudioa7  Python interface to PortAudio.

Provides methods to:
 - initialize and terminate PortAudio
 - open and close streams
 - query and inspect the available PortAudio Host APIs
 - query and inspect the available PortAudio audio devices.

**Stream Management**
  :py:func:`open`, :py:func:`close`

**Host API**
  :py:func:`get_host_api_count`, :py:func:`get_default_host_api_info`,
  :py:func:`get_host_api_info_by_type`,
  :py:func:`get_host_api_info_by_index`,
  :py:func:`get_device_info_by_host_api_device_index`

**Device API**
  :py:func:`get_device_count`, :py:func:`is_format_supported`,
  :py:func:`get_default_input_device_info`,
  :py:func:`get_default_output_device_info`,
  :py:func:`get_device_info_by_index`

**Stream Format Conversion**
  :py:func:`get_sample_size`, :py:func:`get_format_from_width`

**Details**
c            	          a  ] tR tRt o RtRRRR]P                  RRRR3	R ltR tR t	R	 t
R
 tR tR tR tR tR tRR ltRR ltR tR tRtV tR# )PyAudio.Streami  a  PortAudio Stream Wrapper. Use :py:func:`PyAudio.open` to instantiate.

**Opening and Closing**
  :py:func:`__init__`, :py:func:`close`

**Stream Info**
  :py:func:`get_input_latency`, :py:func:`get_output_latency`,
  :py:func:`get_time`, :py:func:`get_cpu_load`

**Stream Management**
  :py:func:`start_stream`, :py:func:`stop_stream`, :py:func:`is_active`,
  :py:func:`is_stopped`

**Input Output**
  :py:func:`write`, :py:func:`read`, :py:func:`get_read_available`,
  :py:func:`get_write_available`
FNTc                   V'       g   V'       g   \        R4      hWn        WPn        W`n        Wn        W n        W0n        W@n        Wn        RVRVRVRVRVRVRVRV	/pV'       d   VVR	&   V'       d   VVR
&   V'       d   WR&   \        P                  ! R/ VB V n        V P                  P                  V n        V P                  P                  V n        V P                  '       d#   \        P                   ! V P                  4       R# R# )a  Initialize an audio stream.

Do not call directly. Use :py:func:`PyAudio.open`.

A stream can either be input, output, or both.

:param PA_manager: A reference to the managing :py:class:`PyAudio`
    instance
:param rate: Sampling rate
:param channels: Number of channels
:param format: Sampling size and format. See |PaSampleFormat|.
:param input: Specifies whether this is an input stream.
    Defaults to ``False``.
:param output: Specifies whether this is an output stream.
    Defaults to ``False``.
:param input_device_index: Index of Input Device to use.
    Unspecified (or ``None``) uses default device.
    Ignored if `input` is ``False``.
:param output_device_index:
    Index of Output Device to use.
    Unspecified (or ``None``) uses the default device.
    Ignored if `output` is ``False``.
:param frames_per_buffer: Specifies the number of frames per buffer.
:param start: Start the stream running immediately.
    Defaults to ``True``. In general, there is no reason to set
    this to ``False``.
:param input_host_api_specific_stream_info: Specifies a host API
    specific stream information data structure for input.

    .. only:: pamac

       See :py:class:`PaMacCoreStreamInfo`.

:param output_host_api_specific_stream_info: Specifies a host API
    specific stream information data structure for output.

    .. only:: pamac

       See :py:class:`PaMacCoreStreamInfo`.

:param stream_callback: Specifies a callback function for
    *non-blocking* (callback) operation.  Default is
    ``None``, which indicates *blocking* operation (i.e.,
    :py:func:`PyAudio.Stream.read` and
    :py:func:`PyAudio.Stream.write`).  To use non-blocking
    operation, specify a callback that conforms to the following
    signature:

    .. code-block:: python

       callback(in_data,      # input data if input=True; else None
                frame_count,  # number of frames
                time_info,    # dictionary
                status_flags) # PaCallbackFlags

    ``time_info`` is a dictionary with the following keys:
    ``input_buffer_adc_time``, ``current_time``, and
    ``output_buffer_dac_time``; see the PortAudio
    documentation for their meanings.  ``status_flags`` is one
    of |PaCallbackFlags|.

    The callback must return a tuple:

    .. code-block:: python

        (out_data, flag)

    ``out_data`` is a byte array whose length should be the
    (``frame_count * channels * bytes-per-channel``) if
    ``output=True`` or ``None`` if ``output=False``.  ``flag``
    must be either :py:data:`paContinue`, :py:data:`paComplete` or
    :py:data:`paAbort` (one of |PaCallbackReturnCodes|).
    When ``output=True`` and ``out_data`` does not contain at
    least ``frame_count`` frames, :py:data:`paComplete` is
    assumed for ``flag``.

    **Note:** ``stream_callback`` is called in a separate
    thread (from the main thread).  Exceptions that occur in
    the ``stream_callback`` will:

    1. print a traceback on standard error to aid debugging,
    2. queue the exception to be thrown (at some point) in
       the main thread, and
    3. return `paAbort` to PortAudio to stop the stream.

    **Note:** Do not call :py:func:`PyAudio.Stream.read` or
    :py:func:`PyAudio.Stream.write` if using non-blocking operation.

    **See:** PortAudio's callback signature for additional
    details: http://portaudio.com/docs/v19-doxydocs/portaudio_8h.html#a8a60fb2a5ec9cbade3f54a9c978e2710

:raise ValueError: Neither input nor output are set True.
ratechannelsr   inputoutputinput_device_indexoutput_device_indexframes_per_buffer#input_host_api_specific_stream_info$output_host_api_specific_stream_infostream_callbackNz'Must specify an input or output stream.r   )r   _parent	_is_input
_is_output_is_running_rate	_channels_format_frames_per_bufferr   open_streaminputLatency_input_latencyoutputLatency_output_latencystart_stream)self
PA_managerr   r    r   r!   r"   r#   r$   r%   startr&   r'   r(   	argumentss   &&&&&&&&&&&&&& r   __init__PyAudio.Stream.__init__)  s
   V V !OPP%L"N$O$J%N!L&7# H&&$&8%':#%6	I 3 8 9 4 9 : />+, 77/Y/DL"&,,";";D#'<<#=#=D -  r   c                    \         P                  ! V P                  4       RV n        V P                  P                  V 4       R# )zCloses the stream.FN)r   closer2   r,   r)   _remove_streamr8   s   &r   r?   PyAudio.Stream.close  s,    HHT\\"$DLL''-r   c                .    V P                   P                  # )z*Returns the input latency.

:rtype: float
)r2   r3   rA   s   &r   get_input_latency PyAudio.Stream.get_input_latency  s    
 <<,,,r   c                .    V P                   P                  # )z+Returns the output latency.

:rtype: float
)r2   r5   rA   s   &r   get_output_latency!PyAudio.Stream.get_output_latency  s    
 <<---r   c                B    \         P                  ! V P                  4      # )z$Returns stream time.

:rtype: float
)r   get_stream_timer2   rA   s   &r   get_timePyAudio.Stream.get_time  s    
 %%dll33r   c                B    \         P                  ! V P                  4      # )zLReturn the CPU load. Always 0.0 when using the blocking API.

:rtype: float
)r   get_stream_cpu_loadr2   rA   s   &r   get_cpu_loadPyAudio.Stream.get_cpu_load  s    
 ))$,,77r   c                |    V P                   '       d   R# \        P                  ! V P                  4       RV n         R# )zStarts the stream.NT)r,   r   r7   r2   rA   s   &r   r7   PyAudio.Stream.start_stream  s)    OODLL)#Dr   c                |    V P                   '       g   R# \        P                  ! V P                  4       RV n         R# )zStops the stream.NF)r,   r   stop_streamr2   rA   s   &r   rT   PyAudio.Stream.stop_stream  s)    ###NN4<<($Dr   c                B    \         P                  ! V P                  4      # )z4Returns whether the stream is active.

:rtype: bool
)r   is_stream_activer2   rA   s   &r   	is_activePyAudio.Stream.is_active  s    
 &&t||44r   c                B    \         P                  ! V P                  4      # )z5Returns whether the stream is stopped.

:rtype: bool
)r   is_stream_stoppedr2   rA   s   &r   
is_stoppedPyAudio.Stream.is_stopped  s    
 ''55r   c                   V P                   '       g   \        R\        4      hVfB   \        V P                  4      p\        \        V4      V P                  V,          ,          4      p\        P                  ! V P                  WV4       R# )aN  Write samples to the stream for playback.

Do not call when using non-blocking mode.

:param frames:
   The frames of data.
:param num_frames:
   The number of frames to write.
   Defaults to None, in which this value will be
   automatically computed.
:param exception_on_underflow:
   Specifies whether an IOError exception should be thrown
   (or silently ignored) on buffer underflow. Defaults
   to False for improved performance, especially on
   slower platforms.

:raises IOError: if the stream is not an output stream
   or if the write operation was unsuccessful.

:rtype: `None`
zNot output streamN)r+   IOError paCanNotWriteToAnInputOnlyStreamr   r/   intlenr.   r   write_streamr2   )r8   frames
num_framesexception_on_underflowr   s   &&&& r   writePyAudio.Stream.write  sk    , ???1>@ @ !'5 V0F!GH
OODLL&24r   c                    V P                   '       g   \        R\        4      h\        P                  ! V P
                  VV4      # )a  Read samples from the stream.

Do not call when using non-blocking mode.

:param num_frames: The number of frames to read.
:param exception_on_overflow:
   Specifies whether an IOError exception should be thrown
   (or silently ignored) on input buffer overflow. Defaults
   to True.
:raises IOError: if stream is not an input stream
  or if the read operation was unsuccessful.
:rtype: bytes
zNot input stream)r*   r_   "paCanNotReadFromAnOutputOnlyStreamr   read_streamr2   )r8   re   exception_on_overflows   &&&r   readPyAudio.Stream.read)  s>     >>>0@B B>>$,,
"79 9r   c                B    \         P                  ! V P                  4      # )zOReturn the number of frames that can be read without waiting.

:rtype: integer
)r   get_stream_read_availabler2   rA   s   &r   get_read_available!PyAudio.Stream.get_read_available=  s    
 //==r   c                B    \         P                  ! V P                  4      # )zRReturn the number of frames that can be written without waiting.

:rtype: integer
)r   get_stream_write_availabler2   rA   s   &r   get_write_available"PyAudio.Stream.get_write_availableD  s    
 00>>r   )r.   r/   r0   r4   r*   r+   r,   r6   r)   r-   r2   )NFT)__name__
__module____qualname____firstlineno____doc__r   paFramesPerBufferUnspecifiedr<   r?   rD   rG   rK   rO   r7   rT   rX   r\   rg   rm   rq   ru   __static_attributes____classdictcell____classdict__s   @r   Streamr     s{     	, !!(,)-')'F'F9=:>%)V	.p	.	-	.	4	8	$	%	5	6 	4D	9(	>	? 	?r   r   c                N    \         P                  ! 4        \        4       V n        R# )zInitialize PortAudio.N)r   
initializeset_streamsrA   s   &r   r<   PyAudio.__init__M  s    
r   c                    V P                   P                  4        F  pVP                  4        K  	  \        4       V n         \        P
                  ! 4        R# )zTerminates PortAudio.

:attention: Be sure to call this method for every instance of this
  object to release PortAudio resources.
N)r   copyr?   r   r   	terminater8   streams   & r   r   PyAudio.terminateR  s8     mm((*FLLN + 
r   c                .    \         P                  ! V4      # )zReturns the size (in bytes) for the specified sample `format`
(a |PaSampleFormat| constant).

:param format: A |PaSampleFormat| constant.
:raises ValueError: Invalid specified `format`.
:rtype: integer
r   )r8   r   s   &&r   r   PyAudio.get_sample_size`  s     !!&))r   c                    \        W4      # )a  Returns a PortAudio format constant for the specified `width`.

:param width: The desired sample width in bytes (1, 2, 3, or 4)
:param unsigned: For 1 byte width, specifies signed or unsigned format.

:raises ValueError: for invalid `width`
:rtype: A |PaSampleFormat| constant.
)r   )r8   r   r   s   &&&r   r   PyAudio.get_format_from_widthj  s     %U55r   c                p    \         P                  ! V .VO5/ VB pV P                  P                  V4       V# )zOpens a new stream.

See constructor for :py:func:`PyAudio.Stream.__init__` for parameter
details.

:returns: A new :py:class:`PyAudio.Stream`
)r   r   r   add)r8   argskwargsr   s   &*, r   r1   PyAudio.openw  s3     6t6v6&!r   c                d    WP                   9  d   \        RV R24      hVP                  4        R# )zCloses a stream. Use :py:func:`PyAudio.Stream.close` instead.

:param stream: An instance of the :py:class:`PyAudio.Stream` object.
:raises ValueError: if stream does not exist.
zStream z
 not foundN)r   r   r?   r   s   &&r   r?   PyAudio.close  s+     &wvhj9::r   c                `    WP                   9   d   V P                   P                  V4       R# R# )zcRemoves a stream. (Internal)

:param stream: An instance of the :py:class:`PyAudio.Stream` object.
N)r   remover   s   &&r   r@   PyAudio._remove_stream  s%    
 ]]"MM  ( #r   c                ,    \         P                  ! 4       # )zFReturns the number of available PortAudio Host APIs.

:rtype: integer
)r   get_host_api_countrA   s   &r   r   PyAudio.get_host_api_count  s    
 $$&&r   c                N    \         P                  ! 4       pV P                  V4      # )zReturns a dictionary containing the default Host API parameters.

The keys of the dictionary mirror the data fields of PortAudio's
``PaHostApiInfo`` structure.

:raises IOError: if no default input device is available
:rtype: dict
)r   get_default_host_apiget_host_api_info_by_index)r8   default_host_api_indexs   & r   get_default_host_api_info!PyAudio.get_default_host_api_info  s%     "$!8!8!:../EFFr   c                P    \         P                  ! V4      pV P                  V4      # )a2  Returns a dictionary containing the Host API parameters for the
host API specified by the `host_api_type`. The keys of the
dictionary mirror the data fields of PortAudio's ``PaHostApiInfo``
structure.

:param host_api_type: The desired |PaHostAPI|
:raises IOError: for invalid `host_api_type`
:rtype: dict
)r   "host_api_type_id_to_host_api_indexr   )r8   host_api_typeindexs   && r   get_host_api_info_by_type!PyAudio.get_host_api_info_by_type  s%     55mD..u55r   c                N    V P                  V\        P                  ! V4      4      # )a0  Returns a dictionary containing the Host API parameters for the
host API specified by the `host_api_index`. The keys of the
dictionary mirror the data fields of PortAudio's ``PaHostApiInfo``
structure.

:param host_api_index: The host api index
:raises IOError: for invalid `host_api_index`
:rtype: dict
)_make_host_api_dictionaryr   get_host_api_info)r8   host_api_indexs   &&r   r   "PyAudio.get_host_api_info_by_index  s(     --  02 	2r   c                T    \         P                  pV! W4      pV P                  V4      # )aY  Returns a dictionary containing the Device parameters for a
given Host API's n'th device. The keys of the dictionary
mirror the data fields of PortAudio's ``PaDeviceInfo`` structure.

:param host_api_index: The Host API index number
:param host_api_device_index: The n'th device of the host API
:raises IOError: for invalid indices
:rtype: dict
)r   %host_api_device_index_to_device_indexget_device_info_by_index)r8   r   host_api_device_indexlong_method_namedevice_indexs   &&&  r   (get_device_info_by_host_api_device_index0PyAudio.get_device_info_by_host_api_device_index  s+     CC'N,,\::r   c                    RVRVP                   RVP                  RVP                  RVP                  RVP                  RVP
                  /# )zOCreates dictionary like PortAudio's ``PaHostApiInfo`` structure.

:rtype: dict
r   structVersiontypenamedeviceCountdefaultInputDevicedefaultOutputDevice)r   r   r   r   r   r   )r8   r   host_api_structs   &&&r   r   !PyAudio._make_host_api_dictionary  sU     U_::O((O((?66 /"D"D!?#F#F
 	
r   c                ,    \         P                  ! 4       # )z<Returns the number of PortAudio Host APIs.

:rtype: integer
)r   get_device_countrA   s   &r   r   PyAudio.get_device_count  s    
 ""$$r   Nc                    Vf   Vf   \        R\        4      h/ pVe   W(R&   W8R&   WHR&   Ve   WXR&   WhR&   WxR&   \        P                  ! V3/ VB # )au  Checks if specified device configuration is supported.

Returns True if the configuration is supported; raises ValueError
otherwise.

:param rate:
   Specifies the desired rate (in Hz)
:param input_device:
   The input device index. Specify ``None`` (default) for
   half-duplex output-only streams.
:param input_channels:
   The desired number of input channels. Ignored if
   `input_device` is not specified (or ``None``).
:param input_format:
   PortAudio sample format constant defined
   in this module
:param output_device:
   The output device index. Specify ``None`` (default) for
   half-duplex input-only streams.
:param output_channels:
   The desired number of output channels. Ignored if
   `input_device` is not specified (or ``None``).
:param output_format:
   |PaSampleFormat| constant.

:rtype: bool
:raises ValueError: tuple containing (error string, |PaErrorCode|).
z5Must specify stream format for input, output, or bothinput_deviceinput_channelsinput_formatoutput_deviceoutput_channelsoutput_format)r   paInvalidDevicer   is_format_supported)	r8   r   r   r   r   r   r   r   r   s	   &&&&&&&& r   r   PyAudio.is_format_supported  s~    F M$9G! ! #%1>"'5#$%1>"$&3?#(7$%&3?#%%d5f55r   c                N    \         P                  ! 4       pV P                  V4      # )zReturns the default input device parameters as a dictionary.

The keys of the dictionary mirror the data fields of PortAudio's
``PaDeviceInfo`` structure.

:raises IOError: No default input device available.
:rtype: dict
)r   get_default_input_devicer   r8   r   s   & r   get_default_input_device_info%PyAudio.get_default_input_device_info#  s#     224,,\::r   c                N    \         P                  ! 4       pV P                  V4      # )zReturns the default output device parameters as a dictionary.

The keys of the dictionary mirror the data fields of PortAudio's
``PaDeviceInfo`` structure.

:raises IOError: No default output device available.
:rtype: dict
)r   get_default_output_devicer   r   s   & r   get_default_output_device_info&PyAudio.get_default_output_device_info/  s#     335,,\::r   c                N    V P                  V\        P                  ! V4      4      # )a  Returns the device parameters for device specified in `device_index`
as a dictionary. The keys of the dictionary mirror the data fields of
PortAudio's ``PaDeviceInfo`` structure.

:param device_index: The device index
:raises IOError: Invalid `device_index`.
:rtype: dict
)_make_device_info_dictionaryr   get_device_infor   s   &&r   r    PyAudio.get_device_info_by_index;  s(     00|,. 	.r   c                v   VP                   p\        P                  ! RR7      pVR3 F  p VP                  V4      p M	  RVRVP                  RVRVP
                  RVP                  R	VP                  R
VP                  RVP                  RVP                  RVP                  RVP                  /#     K  ; i)zPCreates a dictionary like PortAudio's ``PaDeviceInfo`` structure.

:rtype: dict
F)do_setlocalezutf-8r   r   r   hostApimaxInputChannelsmaxOutputChannelsdefaultLowInputLatencydefaultLowOutputLatencydefaultHighInputLatencydefaultHighOutputLatencydefaultSampleRate)r   localegetpreferredencodingdecoder   r   r   r   r   r   r   r   r   )r8   r   device_infodevice_nameos_encodingcodecs   &&&   r   r   $PyAudio._make_device_info_dictionaryH  s    
 "&& 11uE!7+E)007 , !:!:;.."K$@$@#[%B%B(22)33)33*44#--/ 	/s   B33B8)r   rw   )NNNNNN)rx   ry   rz   r{   r|   r   r<   r   r   r   r1   r?   r@   r   r   r   r   r   r   r   r   r   r   r   r   r~   r   r   s   @r   r   r      s}     :r? r?l	

*	6
	)'
G62; 
"%36j
;
;. /  /r   r   paMacCoreStreamInfoc                   T  a a ] tR tRt oRt]P                  t]P                  t]P                  t]P                  t	]P                  t
]P                  t]P                  t]P                  t]P                  t]P                  t]P                   tRV 3R lltR tR tR tRtVtV ;t# )	PaMacCoreStreamInfoin  az  PortAudio Host API Specific Stream Info for macOS-specific settings.

To configure macOS-specific settings, instantiate this class and pass
it as the argument in :py:func:`PyAudio.open` to parameters
``input_host_api_specific_stream_info`` or
``output_host_api_specific_stream_info``.  (See
:py:func:`PyAudio.Stream.__init__`.)

:note: macOS-only.

.. |PaMacCoreFlags| replace:: :ref:`PortAudio Mac Core Flags <PaMacCoreFlags>`
.. _PaMacCoreFlags:

**PortAudio Mac Core Flags**
  :py:data:`paMacCoreChangeDeviceParameters`,
  :py:data:`paMacCoreFailIfConversionRequired`,
  :py:data:`paMacCoreConversionQualityMin`,
  :py:data:`paMacCoreConversionQualityMedium`,
  :py:data:`paMacCoreConversionQualityLow`,
  :py:data:`paMacCoreConversionQualityHigh`,
  :py:data:`paMacCoreConversionQualityMax`,
  :py:data:`paMacCorePlayNice`,
  :py:data:`paMacCorePro`,
  :py:data:`paMacCoreMinimizeCPUButPlayNice`,
  :py:data:`paMacCoreMinimizeCPU`

.. attribute:: flags

   The flags specified to the constructor.

   :type: |PaMacCoreFlags|

.. attribute:: channel_map

   The channel_map specified to the constructor

   :type: tuple or None if unspecified
c                L   < / pVe   WR&   Ve   W#R&   \         SV `  ! R/ VB  R# )a  Initialize with macOS setting flags and channel_map.

See PortAudio documentation for more details on these parameters.

:param flags: |PaMacCoreFlags| OR'ed together.
:param channel_map: An array describing the channel mapping.
    See PortAudio documentation for usage.
Nflagschannel_mapr   )superr<   )r8   r   r   r   	__class__s   &&& r   r<   PaMacCoreStreamInfo.__init__  s5     F "'w&(3}%G&v&r   c                T    \         P                  ! R\        ^R7       V P                  # )zReturns the flags set at instantiation. Deprecated.

:rtype: integer

.. deprecated:: 0.2.13
   Use :py:attr:`flags` property.
zLPaMacCoreStreamInfo.get_flags is deprecated. Use the flags property instead.
stacklevel)warningswarnDeprecationWarningr   rA   s   &r   	get_flagsPaMacCoreStreamInfo.get_flags  s'     MM$"	
 ::r   c                T    \         P                  ! R\        ^R7       V P                  # )zReturns the channel map set at instantiation. Deprecated.

:rtype: tuple or None

.. deprecated:: 0.2.13
   Use :py:attr:`channel_map` property.
zXPaMacCoreStreamInfo.get_channel_map is deprecated. Use the channel_map property instead.r   )r   r   r   r   rA   s   &r   get_channel_map#PaMacCoreStreamInfo.get_channel_map  s)     MM0"	
 ###r   c                @    \         P                  ! R\        ^R7       V # )zZReturns the underyling stream info.

.. :deprecated:: 0.2.13
   Use stream_info property.
z`PaMacCoreStreamInfo._get_host_api_stream_object is deprecated. Use this object instance instead.r   )r   r   r   rA   s   &r   _get_host_api_stream_object/PaMacCoreStreamInfo._get_host_api_stream_object  s#     MM@"	
 Kr   r   )NN)rx   ry   rz   r{   r|   r   paMacCoreChangeDeviceParameters!paMacCoreFailIfConversionRequiredpaMacCoreConversionQualityMin paMacCoreConversionQualityMediumpaMacCoreConversionQualityLowpaMacCoreConversionQualityHighpaMacCoreConversionQualityMaxpaMacCorePlayNicepaMacCorePropaMacCoreMinimizeCPUButPlayNicepaMacCoreMinimizeCPUr<   r   r   r  r~   r   __classcell__r   r   s   @@r   r   r   n  s     %	L +-*L*L',.,P,P)(*(H(H%+-+N+N((*(H(H%)+)J)J&(*(H(H%00*,*L*L'!66	'$		$	 	r   r   c                   6   a a ] tR tRt oRtV 3R ltRtVtV ;t# )r   i  zReserved. Do not instantiate.c                b   < \         P                  ! R \        ^R7       \        SV `  ! V/ VB  R# )zDo not instantiate pyaudio.Stream directly. Use pyaudio.PyAudio.open() instead. pyaudio.Stream may change or be removed in the future.r   N)r   r   r   r   r<   )r8   r   r   r   s   &*,r   r<   Stream.__init__  s0    % 	 	$)&)r   r   )	rx   ry   rz   r{   r|   r<   r~   r   r  r  s   @@r   r   r     s     '* *r   r   rw   )Or|   
__author____version____docformat__r   r   pyaudio._portaudio
_portaudior   ImportErrorprintr   paInt32r   r   r   r
   paCustomFormatpaInDevelopmentpaDirectSoundpaMMEpaASIOpaSoundManagerpaCoreAudiopaOSSpaALSApaALpaBeOSpaWDMKSpaJACKpaWASAPI
paNoDevice	paNoErrorpaNotInitializedpaUnanticipatedHostErrorpaInvalidChannelCountpaInvalidSampleRater   paInvalidFlagpaSampleFormatNotSupportedpaBadIODeviceCombinationpaInsufficientMemorypaBufferTooBigpaBufferTooSmallpaNullCallbackpaBadStreamPtr
paTimedOutpaInternalErrorpaDeviceUnavailable'paIncompatibleHostApiSpecificStreamInfopaStreamIsStoppedpaStreamIsNotStoppedpaInputOverflowedpaOutputUnderflowedpaHostApiNotFoundpaInvalidHostApipaCanNotReadFromACallbackStreampaCanNotWriteToACallbackStreamrj   r`   paIncompatibleStreamHostApi
paContinue
paCompletepaAbortpaInputUnderflowpaInputOverflowpaOutputUnderflowpaOutputOverflowpaPrimingOutputr}   r   r   r   r   r   hasattrr   r   r   r   r   r   <module>rN     s#  .N` 
%  
# LL	
**
**
**	
**"" $$  
	""nn
		ww	
**	;;]]
 LL	&& 66 00 ,, $$  :: 66 .. ""&& """"]]
$$,, .. ((( .. (( ,, (( && "$"D"D !#!B!B %'%J%J "#%#F#F   <<  ]]
]]

** && $$(( && $$  ">> 
&02!o	/ o	/h 2$%%nb44 np*W^^ *m  
	
GH	
s   L/ /M 