Skip to main content

Crate audio

Crate audio 

Source
Expand description

PCM character-device commands, bounded playback, and a fixed-capacity mixer.

Backends own their hardware stream and a Renderer; callers own the PlaybackBuffer or AudioSystem storage. Codecs and resampling belong to applications.

Structs§

AudioStreamDevice
The local /dev/audio/playback character device.
AudioSystem
A fixed pool of independent 48 kHz stereo interleaved F32 streams and outputs.
Configuration
Fixed-width device payload. Frames contain one sample per interleaved channel.
FailureReporter
A cheap handle for host error callbacks and backend teardown.
GET_CONFIGURATION
GET_VOLUME
GET_WRITABLE
OutputDevice
Serializes writers; the callback never takes this lock.
OutputHandle
One independently drained output queue. Dropping it releases its output slot.
OutputReservation
Keeps a transferred native output slot reserved until the adapter is dropped.
PlaybackBuffer
Caller-owned storage, including exactly N PCM bytes plus control/cursor state.
Renderer
The only consumer of a playback queue, owned by the hardware callback. All render methods return frames consumed and fill the remainder with silence.
SET_CONFIGURATION
SET_VOLUME
START
STOP
StreamHandle
An exclusive reservation of one application stream; dropping it frees the slot.

Enums§

SampleFormat
The little-endian representation of one PCM sample in the device byte stream.