std1.0.0-beta-7 SafeC docs

std :: audio::s24

Struct std::S24

#include <std/audio/s24.h> source

struct S24 {
    unsigned char b[3];
}

Fields

§unsigned char b[3]source

two's complement, least significant byte first

Methods

§static struct S24 of(int v)source · definition

The sample with value 'v', clamped to [S24_MIN, S24_MAX].

§static struct S24 from_f32(float v)source · definition

A float in [-1, 1] scaled by 2^23 - 1, rounded to nearest and clamped (out-of-range values saturate).

§int value() constsource · definition

sign-extended, S24_MIN .. S24_MAX

§float to_f32() constsource · definition

value() / 2^23: S24_MIN is exactly -1.0

§void set(int v)source · definition

clamped, as of()