code wiki / (root) / nx_voice_eval.nx

nx_voice_eval.nx

buildroot/runtime/nx_voice_eval.nx

9027 B145 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic voice
docsdependenciesstructsconstsfunctions

about

nx_voice_eval.nx -- THE RULER (voice-realism census V0): a sovereign OBJECTIVE audio-naturalness evaluator so every future voice claim is a MEASURED NUMBER, not an adjective (operator 2026-07-04: "what you are saying vs what is reality"). Reads a WAV and computes reference-free naturalness PROXIES via integer autocorrelation: * F0 (pitch) per frame -> MEAN F0 + F0 STDDEV (Hz) [the monotone tell: robotic synth = ~0 Hz variation; natural speech = ~20-60 Hz] * PERIODICITY / harmonic strength (autocorr peak / energy) = a harmonic-to-noise PROXY * % voiced frames * a MONOTONE flag + a 0-100 naturalness PROXY (honest: NOT human MOS -- MOS needs a human panel; this is an objective correlate that catches flat/robotic prosody, and it MEASURES the jump when neural TTS lands). Integer/deterministic, no float, no ML. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_voice_eval.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close vw sys_write vn sys_mmap ↻ sys_write ↻ isqrt sys_exit

structs

none

consts

12const K_MAGIC_65536: i64 = 65536
13const K_MAGIC_16777216: i64 = 16777216
14const K_MAGIC_32768: i64 = 32768
15const K_MAGIC_4096: i64 = 4096
16const K_MAGIC_2000: i64 = 2000
17const K_MAGIC_100000: i64 = 100000
18const K_MAGIC_20000: i64 = 20000
19const K_MAGIC_3000: i64 = 3000
20const K_MAGIC_10000: i64 = 10000
21const K_MAGIC_32000: i64 = 32000

functions

23func vw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
24func vn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m} 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(1,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
25func isqrt(v: i64) -> i64 { if v<=0 {return 0} var x: i64=v; var y: i64=(x+1)/2; while y<x { x=y; y=(x+v/x)/2 } return x }
called by 1: main
27func main() -> i64