# API Documentation

Play and Record Sound with Python.

API overview:

  - Convenience functions to play and record NumPy arrays: `play()`, `rec()`, `playrec()` and the related functions `wait()`, `stop()`, `get_status()`, `get_stream()`

  - Functions to get information about the available hardware: `query_devices()`, `query_hostapis()`, `check_input_settings()`, `check_output_settings()`

  - Module-wide default settings: `default`

  - Platform-specific settings: `AsioSettings`, `CoreAudioSettings`, `WasapiSettings`

  - PortAudio streams, using NumPy arrays: `Stream`, `InputStream`, `OutputStream`

  - PortAudio streams, using Python buffer objects (NumPy not needed): `RawStream`, `RawInputStream`, `RawOutputStream`

  - Miscellaneous functions and classes: `sleep()`, `get_portaudio_version()`, `CallbackFlags`, `CallbackStop`, `CallbackAbort`

Online documentation:

  https://python-sounddevice.readthedocs.io/

- Convenience Functions using NumPy Arrays
  - `play()`
  - `rec()`
  - `playrec()`
  - `wait()`
  - `stop()`
  - `get_status()`
  - `get_stream()`
- Checking Available Hardware
  - `query_devices()`
  - `DeviceList`
  - `query_hostapis()`
  - `check_input_settings()`
  - `check_output_settings()`
- Module-wide Default Settings
  - `default`
    - `default.device`
    - `default.channels`
    - `default.dtype`
    - `default.latency`
    - `default.extra_settings`
    - `default.samplerate`
    - `default.blocksize`
    - `default.clip_off`
    - `default.dither_off`
    - `default.never_drop_input`
    - `default.prime_output_buffers_using_stream_callback`
    - `default.hostapi`
    - `default.reset()`
- Platform-specific Settings
  - `AsioSettings`
  - `CoreAudioSettings`
  - `WasapiSettings`
- Streams using NumPy Arrays
  - `Stream`
    - `Stream.abort()`
    - `Stream.active`
    - `Stream.blocksize`
    - `Stream.channels`
    - `Stream.close()`
    - `Stream.closed`
    - `Stream.cpu_load`
    - `Stream.device`
    - `Stream.dtype`
    - `Stream.latency`
    - `Stream.read()`
    - `Stream.read_available`
    - `Stream.samplerate`
    - `Stream.samplesize`
    - `Stream.start()`
    - `Stream.stop()`
    - `Stream.stopped`
    - `Stream.time`
    - `Stream.write()`
    - `Stream.write_available`
  - `InputStream`
  - `OutputStream`
- Raw Streams
  - `RawStream`
    - `RawStream.read()`
    - `RawStream.write()`
  - `RawInputStream`
  - `RawOutputStream`
- Miscellaneous
  - `sleep()`
  - `get_portaudio_version()`
  - `CallbackFlags`
    - `CallbackFlags.input_underflow`
    - `CallbackFlags.input_overflow`
    - `CallbackFlags.output_underflow`
    - `CallbackFlags.output_overflow`
    - `CallbackFlags.priming_output`
  - `CallbackStop`
  - `CallbackAbort`
  - `PortAudioError`
    - `PortAudioError.args`
- Expert Mode
  - `_initialize()`
  - `_terminate()`
  - `_split()`
  - `_StreamBase`