read

fun read(bytes: ByteArray, fileName: String? = null): AudioRecording

Reads an audio file from an in-memory byte array.

Format is auto-detected from magic bytes; fileName provides an extension fallback when magic is inconclusive.

Throws

if the bytes are not a valid audio file.

if the audio encoding is not supported.