AudioFormat

data class AudioFormat(val sampleRate: Int, val channels: Channels, val encoding: SampleEncoding)

Canonical audio format

Constructors

Link copied to clipboard
constructor(sampleRate: Int, channels: Channels, encoding: SampleEncoding)

Properties

Link copied to clipboard

Bytes per frame = per-sample * channels (for interleaved); planar uses per-plane frame size.

Link copied to clipboard

Bytes per (single-channel) sample.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Serializes this format to a binary blob suitable for wire transfer or storage.

Link copied to clipboard
fun AudioFormat.toAVAudioFormat(): AVAudioFormat

Converts this common AudioFormat to an AVAudioFormat instance.