AudioFormat

data class AudioFormat(val sampleRate: Int, val channels: Int, val sampleFormat: SampleFormat, val channelLayout: ChannelLayout = ChannelLayout.forChannelCount(channels), val channelLayoutMask: Long? = null)

The shape of PCM: sampleRate sample frames a second, each holding channels samples of sampleFormat.

Constructors

Link copied to clipboard
constructor(sampleRate: Int, channels: Int, sampleFormat: SampleFormat, channelLayout: ChannelLayout = ChannelLayout.forChannelCount(channels), channelLayoutMask: Long? = null)

Properties

Link copied to clipboard

Bytes in one sample frame, one sample for every channel.

Link copied to clipboard
Link copied to clipboard

Which speaker each channel drives, as the native order mask: one bit per speaker, channels in the order of those bits from the lowest upward.

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

Functions

Link copied to clipboard
fun durationOf(frames: Int): Pts

Duration of frames sample frames at this rate.

Link copied to clipboard
fun framesIn(duration: Pts): Int

Sample frames in duration at this rate, rounded down.