ofAudio

expect fun ofAudio(bytes: ByteArray, sampleCount: Int, sampleRate: Int, channels: Int, sampleFormat: SampleFormat, ptsMicros: Long = FrameInfo.NOPTS): Frame

Build an audio frame from raw sample bytes. bytes layout: planar formats are plane-after-plane (all of channel 0, then channel 1, …), packed formats are interleaved. Both match what copyPlanesToByteArray produces. Channels beyond 8 are unsupported.

Throws

on unknown sample format, allocation failure, or short bytes

actual fun ofAudio(bytes: ByteArray, sampleCount: Int, sampleRate: Int, channels: Int, sampleFormat: SampleFormat, ptsMicros: Long): Frame

Build an audio frame from raw sample bytes. bytes layout: planar formats are plane-after-plane (all of channel 0, then channel 1, …), packed formats are interleaved. Both match what copyPlanesToByteArray produces. Channels beyond 8 are unsupported.

Throws

on unknown sample format, allocation failure, or short bytes

actual fun ofAudio(bytes: ByteArray, sampleCount: Int, sampleRate: Int, channels: Int, sampleFormat: SampleFormat, ptsMicros: Long): Frame

Build an audio frame from raw sample bytes. bytes layout: planar formats are plane-after-plane (all of channel 0, then channel 1, …), packed formats are interleaved. Both match what copyPlanesToByteArray produces. Channels beyond 8 are unsupported.

Throws

on unknown sample format, allocation failure, or short bytes

actual fun ofAudio(bytes: ByteArray, sampleCount: Int, sampleRate: Int, channels: Int, sampleFormat: SampleFormat, ptsMicros: Long): Frame

Build an audio frame from raw sample bytes. bytes layout: planar formats are plane-after-plane (all of channel 0, then channel 1, …), packed formats are interleaved. Both match what copyPlanesToByteArray produces. Channels beyond 8 are unsupported.

Throws

on unknown sample format, allocation failure, or short bytes

actual fun ofAudio(bytes: ByteArray, sampleCount: Int, sampleRate: Int, channels: Int, sampleFormat: SampleFormat, ptsMicros: Long): Frame

Build an audio frame from raw sample bytes. bytes layout: planar formats are plane-after-plane (all of channel 0, then channel 1, …), packed formats are interleaved. Both match what copyPlanesToByteArray produces. Channels beyond 8 are unsupported.

Throws

on unknown sample format, allocation failure, or short bytes