AudioSinkBuffer

interface AudioSinkBuffer

The device's own buffer, to be written in place.

The engine writes through this rather than returning an array so that a device callback can hand over the buffer the OS gave it, with no copy anywhere in the path.

CoreAudio no longer arrives here: its callback is C and writes the device's memory with memcpy and memset inside kprt_ring_render. This stays because it is the shape every other sink uses, including a future AAudio one, and because it is how the portable ring is tested.

Properties

Link copied to clipboard
abstract val format: AudioFormat

The layout of the device buffer, which is the format the sink accepted at open.

Functions

Link copied to clipboard
abstract fun writeInterleaved(source: FloatArray, sourceOffset: Int, destinationFrameOffset: Int, frames: Int)

Interleaved write of frames sample frames, starting at frame destinationFrameOffset of this buffer.

Link copied to clipboard
abstract fun writeSilence(frameOffset: Int, frames: Int)

Fills frames frames from frameOffset with silence.