⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module mixer

Module mixer 

Source
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.0
  • 0x0000_8000 = 0.5
  • 0x0000_0000 = 0.0
  • 0xFFFF_0000 = -1.0

Structs§

AudioMixer
Multi-channel audio mixer with fixed-point arithmetic
MixerChannel
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§

FixedPoint
Fixed-point 16.16 type: 16 integer bits + 16 fractional bits