pcmSeekByteOffset

fun pcmSeekByteOffset(position: Duration, format: AudioFormat, byteCount: Int): Int

Frame-aligned byte offset into a PCM buffer for position.

Returns 0 when the format or buffer cannot be indexed. The offset is always a multiple of AudioFormat.bytesPerFrame and within 0..byteCount.


fun pcmSeekByteOffset(position: Duration, format: AudioFormat, byteCount: Long): Long

Frame-aligned absolute byte offset for position on a Long-sized timeline.

When byteCount is Long.MAX_VALUE (unknown / open-ended ceiling), the result is only clamped to be non-negative and frame-aligned, not to a buffer end.