nx_audio_mix.nx
buildroot/runtime/nx_audio_mix.nx
about
nx_audio_mix.nx -- SOVEREIGN AUDIO ENGINE, rung R0: the PCM mixer atom.
Direct answer to "no FMOD/Wwise -- build S-class from the hardware rung up."
The core of ANY audio engine (FMOD included) is summing sample streams with
per-source gain and clamping to the sample range. This is that, in raw integer
PCM math -- no third party, deterministic, inspectable. Samples are i64 in the
signed-16-bit range; gain is Q8 fixed point (256 = 1.0x). Later rungs: N-chan,
resample, stereo pan, oscillators/ADSR, filters/reverb, 3D spatialization,
codecs -- the ladder to EXCEED FMOD (sovereign + no licensing + deterministic).
license_tier: ORIGINAL.
dependencies 1 imports · 19 importers
diagram shows first 10 each side; +0 more imports, +9 more importers in the complete lists below.
imports: nx_syscalls.nx
imported by: nx_audio_demo_test.nxnx_audio_fx.nxnx_audio_fx_test.nxnx_audio_mix_test.nxnx_audio_pan.nxnx_audio_pan_test.nxnx_audio_resample.nxnx_audio_resample_test.nxnx_audio_sfx.nxnx_audio_sfx_test.nxnx_audio_sfx_web.nxnx_audio_sfx_web_test.nxnx_audio_song_test.nxnx_audio_spatial.nxnx_audio_spatial_test.nxnx_audio_synth.nxnx_audio_synth_test.nxnx_audio_web.nxnx_audio_web_test.nx
structs
| none |
consts
| 14 | const AE_GAIN_UNIT: i64 = 256 // Q8 gain: 256 = 1.0x, 128 = 0.5x |
| 15 | const AE_SMAX: i64 = 32767 // i16 max |
| 16 | const AE_SMIN: i64 = 0 - 32768 // i16 min |
functions
| 19 | func ae_clamp(x: i64) -> i64 |
| 26 | func ae_mix2(a: *i64, b: *i64, ga: i64, gb: i64, out: *i64, n: i64) -> i64 |
| 37 | func ae_mixn(srcs: *i64, gains: *i64, k: i64, out: *i64, n: i64) -> i64 |
| 54 | func ae_gain(buf: *i64, g: i64, n: i64) -> i64 calls 1: ae_clamp |