code wiki / _hdl_build / nx_audio_wire_exceed.nx
nx_audio_wire_exceed.nx
buildroot/runtime/_hdl_build/nx_audio_wire_exceed.nx
about
nx_audio_wire_exceed.nx -- R3: MEASURED audio-codec head-to-head, closing the census's
"audio codec vs Opus = UNMEASURED" axis HONESTLY. The live room ships RAW Int16 PCM
(~768 kbps @48kHz). We REUSE the proven lossless codec nx_nv1_lpc (nv1l_encode/decode,
bit-exact, FLAC-class) and measure it on a realistic talk-spurt signal (50% speech-ish /
50% silence, like a real conversation), then grade per-axis vs TWO baselines:
- the CURRENT live wire (raw Int16): we WIN -- lossless compression of the deployed wire.
- Opus voice (~32 kbps wideband, NAMED YARDSTICK): we are BIGGER -- lossless tax, reported
HONESTLY (Opus is LOSSY-transparent; we are bit-exact). Our exceed there = fidelity
(bit-exact) + sovereign implementation (no libopus), NOT bitrate or patent-freedom
(Opus is already royalty-free/RFC 6716). The anti-wave check REFUSES any "we match
Opus's lossy bitrate" claim.
Program law: "lossless is default" -- the bird-test (record, play back, sounds like real life).
main() is the SELF-VALIDATING GATE. Evidence -> knowledge/status/audio_wire_exceed.log.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_nv1_lpc.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 17 | const AWE_MAGIC_65536: i64 = 65536 |
| 18 | const AWE_MAGIC_8128: i64 = 8128 |
| 19 | const AWE_MAGIC_4096: i64 = 4096 |
| 20 | const AWE_MAGIC_1103515245: i64 = 1103515245 |
| 21 | const AWE_MAGIC_12345: i64 = 12345 |
| 22 | const AWE_MAGIC_1024: i64 = 1024 |
| 23 | const AWE_MAGIC_32768: i64 = 32768 |
| 25 | const AWE_LOG: *u8 = "knowledge/status/audio_wire_exceed.log" |
| 26 | const OPUS_VOICE_KBPS: i64 = 32 // Opus wideband voice typical operating point (named yardstick) |
functions
| 28 | func aw(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 29 | func awn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(fd,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(fd,bb,k); return 0 } |
| 31 | func wr_i16(b: *u8, idx: i64, v: i64) -> i64 { var u: i64=v; if u<0 { u=u+AWE_MAGIC_65536 } b[idx*2]=(u & 255) as u8; b[idx*2+1]=((u/256) & 255) as u8; return 0 } called by 1: main |
| 32 | func tri(i: i64) -> i64 { let ph: i64=i % 256; if ph>=128 { return AWE_MAGIC_8128 - (ph-128)*127 } return ph*127 - AWE_MAGIC_8128 } called by 1: main |
| 35 | func rt(pcm: *u8, n: i64, pay: *u8, dec: *u8) -> i64 |
| 45 | func main() -> i64 |