code wiki / (root) / nx_voice_frame.nx

nx_voice_frame.nx

buildroot/runtime/nx_voice_frame.nx

6678 B190 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic voice
docsdependenciesstructsconstsfunctions

about

nx_voice_frame.nx -- Phase 4a foundation: sovereign voice-codec frame format with CAS-chained sha256 headers. Per docs/NISHI_COMMS_ROADMAP.md Phase 4: the frame format alone is already a WIN over Opus on two axes (audit-ability + content- addressability). Subsequent files compose LPC + range coder + FEC on top of THIS frame structure. Frame wire format (binary, all little-endian): [0..3] magic = "NXVF" (4 bytes) [4] version major (1) (1) [5] tier hint (NX_HW_TIER_*) (1) [6..7] bitrate kbps (2) -- 1..64 [8..9] sample_rate / 1000 (2) -- 8 | 16 | 24 | 48 [10] frame_ms (1) -- 10 | 20 [11] flags (1) -- bit0=voice; bit1=FEC; bit2=neural-residual [12..15] sequence number (4) [16..47] prev_frame_hash (32) sha256 of previous frame's full bytes [48..49] payload_len (2) [50..] payload (variable) After payload, the receiver computes sha256(this entire frame header+payload) and stashes for the NEXT frame's prev_hash. Chain. genealogy_id: rfc_5285_rtp + rfc_6716_opus_packetisation + nx_attest_merkle_chain lineage_id: nishi_voice_frame_q10

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_voice_frame.nx nx_voice_codec.nx

imports: nx_syscalls.nx

imported by: nx_voice_codec.nx

structs

none

consts

71const NX_VFR_VERDICT_UNKNOWN: i64 = 0
72const NX_VFR_VERDICT_OK: i64 = 1
73const NX_VFR_VERDICT_BAD_MAGIC: i64 = 2
74const NX_VFR_VERDICT_VERSION_MISMATCH: i64 = 3
75const NX_VFR_VERDICT_TRUNCATED: i64 = 4
76const NX_VFR_VERDICT_CHAIN_BROKEN: i64 = 5
77const NX_VFR_VERDICT_N: i64 = 6
80const NX_VFR_FLAG_VOICE: i64 = 1
81const NX_VFR_FLAG_FEC: i64 = 2
82const NX_VFR_FLAG_NEURAL_RESIDUAL: i64 = 4
84const NX_VFR_HEADER_BYTES: i64 = 50

functions

46func _h32(buf: *u8, n: i64, out: *u8) -> i64
92func nx_voice_frame_build(
139func nx_voice_frame_parse(
called by 1: nx_voice_codec_decode calls 1: _h32
176func nx_voice_frame_sequence(buf: *u8) -> i64
181func nx_voice_frame_flags(buf: *u8) -> i64
186func nx_vfr_verdict_is_valid(v: i64) -> i64