alsaaudio — alsaaudio documentation 0.10.1 documentation

# `alsaaudio`

## Module Contents

### Classes

`PCM` |
`Mixer` |

### Functions

`pcms`(→ list[str]) |
`cards`(→ list[str]) |
`mixers`(→ list[str]) |
`asoundlib_version`(→ str) |

### Attributes

`PCM_PLAYBACK` |
`PCM_CAPTURE` |
`PCM_NORMAL` |
`PCM_NONBLOCK` |
`PCM_ASYNC` |
`PCM_FORMAT_S8` |
`PCM_FORMAT_U8` |
`PCM_FORMAT_S16_LE` |
`PCM_FORMAT_S16_BE` |
`PCM_FORMAT_U16_LE` |
`PCM_FORMAT_U16_BE` |
`PCM_FORMAT_S24_LE` |
`PCM_FORMAT_S24_BE` |
`PCM_FORMAT_U24_LE` |
`PCM_FORMAT_U24_BE` |
`PCM_FORMAT_S32_LE` |
`PCM_FORMAT_S32_BE` |
`PCM_FORMAT_U32_LE` |
`PCM_FORMAT_U32_BE` |
`PCM_FORMAT_FLOAT_LE` |
`PCM_FORMAT_FLOAT_BE` |
`PCM_FORMAT_FLOAT64_LE` |
`PCM_FORMAT_FLOAT64_BE` |
`PCM_FORMAT_MU_LAW` |
`PCM_FORMAT_A_LAW` |
`PCM_FORMAT_IMA_ADPCM` |
`PCM_FORMAT_MPEG` |
`PCM_FORMAT_GSM` |
`PCM_FORMAT_S24_3LE` |
`PCM_FORMAT_S24_3BE` |
`PCM_FORMAT_U24_3LE` |
`PCM_FORMAT_U24_3BE` |
`PCM_TSTAMP_NONE` |
`PCM_TSTAMP_ENABLE` |
`PCM_TSTAMP_TYPE_GETTIMEOFDAY` |
`PCM_TSTAMP_TYPE_MONOTONIC` |
`PCM_TSTAMP_TYPE_MONOTONIC_RAW` |
`PCM_FORMAT_DSD_U8` |
`PCM_FORMAT_DSD_U16_LE` |
`PCM_FORMAT_DSD_U32_LE` |
`PCM_FORMAT_DSD_U32_BE` |
`PCM_STATE_OPEN` |
`PCM_STATE_SETUP` |
`PCM_STATE_PREPARED` |
`PCM_STATE_RUNNING` |
`PCM_STATE_XRUN` |
`PCM_STATE_DRAINING` |
`PCM_STATE_PAUSED` |
`PCM_STATE_SUSPENDED` |
`PCM_STATE_DISCONNECTED` |
`MIXER_CHANNEL_ALL` |
`MIXER_SCHN_UNKNOWN` |
`MIXER_SCHN_FRONT_LEFT` |
`MIXER_SCHN_FRONT_RIGHT` |
`MIXER_SCHN_REAR_LEFT` |
`MIXER_SCHN_REAR_RIGHT` |
`MIXER_SCHN_FRONT_CENTER` |
`MIXER_SCHN_WOOFER` |
`MIXER_SCHN_SIDE_LEFT` |
`MIXER_SCHN_SIDE_RIGHT` |
`MIXER_SCHN_REAR_CENTER` |
`MIXER_SCHN_MONO` |
`VOLUME_UNITS_PERCENTAGE` |
`VOLUME_UNITS_RAW` |
`VOLUME_UNITS_DB` |

alsaaudio.PCM_PLAYBACK: int

alsaaudio.PCM_CAPTURE: int

alsaaudio.PCM_NORMAL: int

alsaaudio.PCM_NONBLOCK: int

alsaaudio.PCM_ASYNC: int

alsaaudio.PCM_FORMAT_S8: int

alsaaudio.PCM_FORMAT_U8: int

alsaaudio.PCM_FORMAT_S16_LE: int

alsaaudio.PCM_FORMAT_S16_BE: int

alsaaudio.PCM_FORMAT_U16_LE: int

alsaaudio.PCM_FORMAT_U16_BE: int

alsaaudio.PCM_FORMAT_S24_LE: int

alsaaudio.PCM_FORMAT_S24_BE: int

alsaaudio.PCM_FORMAT_U24_LE: int

alsaaudio.PCM_FORMAT_U24_BE: int

alsaaudio.PCM_FORMAT_S32_LE: int

alsaaudio.PCM_FORMAT_S32_BE: int

alsaaudio.PCM_FORMAT_U32_LE: int

alsaaudio.PCM_FORMAT_U32_BE: int

alsaaudio.PCM_FORMAT_FLOAT_LE: int

alsaaudio.PCM_FORMAT_FLOAT_BE: int

alsaaudio.PCM_FORMAT_FLOAT64_LE: int

alsaaudio.PCM_FORMAT_FLOAT64_BE: int

alsaaudio.PCM_FORMAT_MU_LAW: int

alsaaudio.PCM_FORMAT_A_LAW: int

alsaaudio.PCM_FORMAT_IMA_ADPCM: int

alsaaudio.PCM_FORMAT_MPEG: int

alsaaudio.PCM_FORMAT_GSM: int

alsaaudio.PCM_FORMAT_S24_3LE: int

alsaaudio.PCM_FORMAT_S24_3BE: int

alsaaudio.PCM_FORMAT_U24_3LE: int

alsaaudio.PCM_FORMAT_U24_3BE: int

alsaaudio.PCM_TSTAMP_NONE: int

alsaaudio.PCM_TSTAMP_ENABLE: int

alsaaudio.PCM_TSTAMP_TYPE_GETTIMEOFDAY: int

alsaaudio.PCM_TSTAMP_TYPE_MONOTONIC: int

alsaaudio.PCM_TSTAMP_TYPE_MONOTONIC_RAW: int

alsaaudio.PCM_FORMAT_DSD_U8: int

alsaaudio.PCM_FORMAT_DSD_U16_LE: int

alsaaudio.PCM_FORMAT_DSD_U32_LE: int

alsaaudio.PCM_FORMAT_DSD_U32_BE: int

alsaaudio.PCM_STATE_OPEN: int

alsaaudio.PCM_STATE_SETUP: int

alsaaudio.PCM_STATE_PREPARED: int

alsaaudio.PCM_STATE_RUNNING: int

alsaaudio.PCM_STATE_XRUN: int

alsaaudio.PCM_STATE_DRAINING: int

alsaaudio.PCM_STATE_PAUSED: int

alsaaudio.PCM_STATE_SUSPENDED: int

alsaaudio.PCM_STATE_DISCONNECTED: int

alsaaudio.MIXER_CHANNEL_ALL: int

alsaaudio.MIXER_SCHN_UNKNOWN: int

alsaaudio.MIXER_SCHN_FRONT_LEFT: int

alsaaudio.MIXER_SCHN_FRONT_RIGHT: int

alsaaudio.MIXER_SCHN_REAR_LEFT: int

alsaaudio.MIXER_SCHN_REAR_RIGHT: int

alsaaudio.MIXER_SCHN_FRONT_CENTER: int

alsaaudio.MIXER_SCHN_WOOFER: int

alsaaudio.MIXER_SCHN_SIDE_LEFT: int

alsaaudio.MIXER_SCHN_SIDE_RIGHT: int

alsaaudio.MIXER_SCHN_REAR_CENTER: int

alsaaudio.MIXER_SCHN_MONO: int

alsaaudio.VOLUME_UNITS_PERCENTAGE: int

alsaaudio.VOLUME_UNITS_RAW: int

alsaaudio.VOLUME_UNITS_DB: int

alsaaudio.pcms(pcmtype: int) → list[str]

alsaaudio.cards() → list[str]

alsaaudio.mixers(cardindex: int = -1, device: str = 'default') → list[str]

alsaaudio.asoundlib_version() → str

class alsaaudio.PCM(mode: int = PCM_NORMAL, rate: int = 44100, channels: int = 2, format: int = PCM_FORMAT_S16_LE, periodsize: int = 32, periods: int = 4, device: str = 'default', cardindex: int = -1)
  close() → None
  dumpinfo() → None
  info() → dict
  state() → int
  htimestamp() → tuple[int, int, int]
  set_tstamp_mode() → None
  get_tstamp_mode() → int
  set_tstamp_type() → None
  get_tstamp_type() → int
  getformats() → dict
  getratebounds() → tuple[int, int]
  getrates() → int | tuple[int, int] | list[int]
  getchannels() → list[int]
  setchannels() → None
  pcmtype() → int
  pcmmode() → int
  cardname() → str
  setrate() → None
  setformat() → int
  setperiodsize() → int
  read() → tuple[int, bytes]
  write() → int
  avail() → int
  pause() → int
  drop() → int
  drain() → int
  polldescriptors() → list[tuple[int, int]]
  polldescriptors_revents() → int

class alsaaudio.Mixer(id: int = 0, cardindex: int = -1, device: str = 'default')
  cardname() → str
  close() → None
  mixer() → str
  mixerid() → int
  switchcap() → int
  volumecap() → int
  getvolume(units: int = VOLUME_UNITS_PERCENTAGE) → int
  getrange(units: int = VOLUME_UNITS_RAW) → tuple[int, int]
  getenum() → tuple[str, list[str]]
  getmute() → list[int]
  getrec() → list[int]
  setvolume(pcmtype: int = PCM_PLAYBACK, units: int = VOLUME_UNITS_PERCENTAGE, channel: int | None = None) → None
  setenum() → None
  setmute(channel: int | None = None) → None
  setrec(channel: int | None = None) → None
  polldescriptors() → list[tuple[int, int]]
  handleevents() → int