sound.from_pcm

sound

from_pcm(data, channels, fmt) -> buf, err

Decode raw PCM bytes into a sample buffer

Decodes raw interleaved little-endian PCM bytes into a float32 buffer. fmt is one of "u8", "s16", "s24", "s32", "f32".

Used by sound.wav after parsing the RIFF container.

Returns nil and an error string on failure.