Module audio::s24
S24: one packed 24-bit audio sample.
AUDIO_FORMAT_I24 buffers hold signed 24-bit samples packed in 3 bytes, little-endian (no padding byte). S24 is exactly that layout — sizeof(struct S24) == 3, alignment 1 — so a packed buffer is a []S24:
[]S24 out = io.output_i24(); // frames * channels samples
out[i] = S24::from_f32(0.5f);
int raw = out[i].value(); // -8388608 .. 8388607
and audio_convert.h's audio_f32_to_i24 / audio_i24_to_f32 convert whole slices of them. Freestanding-safe.
Structs
| S24 |
Macros
| S24_MIN | |
| S24_MAX |