code wiki / (root) / nx_voiceprint.nx

nx_voiceprint.nx

buildroot/runtime/nx_voiceprint.nx

4720 B127 linesdepth 4pulls 6 transitivereach 6 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_voiceprint.nx -- VOICE-CLONE-001 rung 1: a sovereign SPEAKER-IDENTITY descriptor ("voiceprint") extracted from a voice sample, plus a distance metric that tells two voices apart. A voice is a SOURCE (glottal pulses -> pitch, F0) driving a FILTER (the vocal tract -> formants). A speaker's IDENTITY lives mostly in the FILTER: the same person at a different pitch is still that person. LPC captures the vocal-tract filter exactly; its REFLECTION coefficients (PARCOR) are a compact, bounded (|k|<1), distance-friendly description of that filter. The voiceprint = the average PARCOR vector over the VOICED frames of a sample (voicing gated by nx_pitch) + the mean F0. Because we average only voiced frames and identity rides in the PARCOR (not the pitch), the print is pitch-invariant: the SAME speaker reading at 120 Hz vs 125 Hz prints nearly identical, while a DIFFERENT vocal tract prints far away. That property is the floor under voice DUPLICATION: capture who a speaker IS, separably from what they happen to be saying or how high they happen to be speaking. Composes (no reinvention): nx_lpc_autocorr (R[0..p]) -> nx_lpc_levinson (PARCOR k in Q30) ; nx_pitch (voiced-frame gate + F0). Integer-only, patent-clean. Voiceprint buffer layout (caller-owned *i64, VP_WORDS words): vp[0] = number of voiced frames averaged vp[1] = mean F0 (Hz) vp[2 .. 2+ORDER) = average reflection coeffs k[1..ORDER] in Q30 license_tier: ORIGINAL module: nishi-core.audio.voiceprint depends: nishi-core.audio.pitch, nishi-core.voice.lpc capability: AUDIO_SPEAKER_IDENTITY

dependencies 4 imports · 6 importers

nx_syscalls_x86_64.nx nx_lpc_autocorr.nx nx_lpc_levinson.nx nx_pitch.nx nx_voiceprint.nx nx_g2p_gate.nx nx_phoneme_synth_gate.nx nx_voice_clone_synth.nx nx_voice_clone_synth_gate.nx nx_voice_read_gate.nx nx_voiceprint_gate.nx

imports: nx_syscalls_x86_64.nxnx_lpc_autocorr.nxnx_lpc_levinson.nxnx_pitch.nx

imported by: nx_g2p_gate.nxnx_phoneme_synth_gate.nxnx_voice_clone_synth.nxnx_voice_clone_synth_gate.nxnx_voice_read_gate.nxnx_voiceprint_gate.nx

structs

none

consts

37const VP_ORDER: i64 = 10
38const VP_FRAME: i64 = 256
39const VP_HOP: i64 = 128
40const VP_FS: i64 = 8000
41const VP_MINLAG: i64 = 25
42const VP_MAXLAG: i64 = 114
43const VP_WORDS: i64 = 12 // 2 + VP_ORDER

functions

46func _vp_i64(b: *u8, i: i64) -> i64
58func nx_voiceprint_extract(pcm: *u8, n_samples: i64, vp: *i64) -> i64
116func nx_voiceprint_distance(a: *i64, b: *i64) -> i64
called by 4: mainmainmainmain