WriteFormat

data class WriteFormat(val sampleRate: Int, val channels: Int, val subslotBytes: Int, val validBits: Int, val counterRateHz: Int, val encoding: StreamEncoding = StreamEncoding.PCM)(source)

The layout of what the app writes to the output, and the unit of its position counters.

It is the wire layout of the negotiated StreamFormat for the direct output without conversion (a 24-bit sample may sit in a 3-byte or a 4-byte slot there), and the layout of the request for every other output, including a converting one: little-endian, interleaved, 16-bit in 2 bytes, 24-bit packed in 3, 32-bit in 4 (32-bit float with AAudioConfig.floatSamples).

Constructors

Link copied to clipboard
constructor(sampleRate: Int, channels: Int, subslotBytes: Int, validBits: Int, counterRateHz: Int, encoding: StreamEncoding = StreamEncoding.PCM)

Properties

Link copied to clipboard

Bytes of one frame: the unit PcmOutput.write takes.

Link copied to clipboard

Samples per frame.

Link copied to clipboard

The rate of PcmOutput.playedFrames and PcmOutput.latencyFrames. The audible position is startPosition + playedFrames / counterRateHz.

Link copied to clipboard

Exact source/wire encoding; unsigned8 and float32 must never be interpreted as signed PCM.

Link copied to clipboard

The rate of the frames written.

Link copied to clipboard

Bytes per sample.

Link copied to clipboard

Significant bits of each sample, left-justified in the slot.