Expand description
Fixed-point 16.16 audio mixer
Provides software audio mixing using integer-only arithmetic suitable for kernel context where FPU state is not available. All volume and sample calculations use 16.16 fixed-point representation.
§Fixed-Point Format
A FixedPoint value (i32) stores a number with 16 integer bits and
16 fractional bits. For example:
0x0001_0000= 1.00x0000_8000= 0.50x0000_0000= 0.00xFFFF_0000= -1.0
Structs§
- Audio
Mixer - Multi-channel audio mixer with fixed-point arithmetic
- Mixer
Channel - A single mixer channel representing one audio source
Functions§
- fp_
from_ i16 - Convert a signed 16-bit sample to fixed-point 16.16
- fp_
from_ volume - Convert a volume value (0..65535) to fixed-point (0.0..1.0)
- fp_mul
- Multiply two fixed-point values with saturation
- fp_
to_ i16 - Convert a fixed-point 16.16 value back to signed 16-bit with saturation
- init
- Initialize the global audio mixer
- with_
mixer - Access the global mixer through a closure
Type Aliases§
- Fixed
Point - Fixed-point 16.16 type: 16 integer bits + 16 fractional bits