AUDIO
Source snapshot · 12 October 2026

API reference / ravet_embedded_gain

Crate ravet_embedded_gain 

Expand description

Allocation-free stereo gain reference; gain changes are immediate (no smoothing).

Gain shares the portable processor contract with desktop RAVET but needs no signal/surface crate, allocator, atomics, HAL or OS. Gain ID zero accepts finite amplitudes 0..=4; unknown events/IDs are ignored. C uses block-start gain. The opt-in firmware-panic handler is for standalone bare-metal static libraries; Rust firmware should supply its own handler and leave that feature disabled.

Structs§

Gain
C-layout reference state, exclusively owned by the callback/firmware. Treat fields as opaque in C; initialize through the reference ABI.

Constants§

GAIN_ID
MAXIMUM_FRAMES

Functions§

ravet_embedded_gain_init⚠
Initialize/reinitialize caller-owned state; returns 0 on success, -1 on rejection. Rejection leaves state unchanged. Stop callbacks before initialization.
ravet_embedded_gain_process⚠
Process interleaved stereo f32; exact input/output aliasing is allowed. Returns 0 on success, -1 on rejection. Input/output lengths are bounded to 128 samples. Valid output storage is silenced over its requested active prefix on rejection; tails are preserved. Invalid output length/pointer returns without writes. No allocation, panic recovery, driver or deadline guarantee.
ravet_embedded_gain_set⚠
Set block-start gain; returns 0 on success, -1 on invalid value/null state.