code wiki / _hdl_build / nx_listen_player.nx

nx_listen_player.nx

buildroot/runtime/_hdl_build/nx_listen_player.nx

18008 B181 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_listen_player.nx -- https://nishifamily.com/listen : a sovereign audio PLAYER that uses OUR OWN CODEC end-to-end (operator 2026-06-23: "make sure this is all using our own codec"). Each track's PCM is compressed with our NishiLossless LPC codec (nx_nv1_lpc), self-checked BIT-EXACT at build time, and embedded as base64. The page ships a faithful in-browser port of our decoder (nvDec) -> raw PCM -> a WAV blob WE build -> <audio>. The browser never decodes a third-party codec; it only plays raw PCM that OUR codec produced. A checksum self-test (sum embedded by the encoder, recomputed after decode) turns any decoder mismatch into a VISIBLE badge instead of garbage. Controls: play/stop/loop/shuffle/next/new. Anonymous aggregate beacons to /stat (track,event -- never who, survivorship-aware). license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_base64.nx nx_nv1_lpc.nx nx_syscalls.nx nx_listen_player.nx

imports: nx_base64.nxnx_nv1_lpc.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main mp sys_write sys_mmap app emit_track read_file sys_openat_rd sys_read sys_close iabs i16 nv1l_encode nv1_wr_u32 nv1l_rd_i16 nv1l_residuals nv1l_best_k nv1l_cost_bits nv1l_rice_put nv1l_bit_put nv1l_decode nv1_rd_u32 nv1l_rd_i16 ↻ nv1l_wr_i16 nv1l_rice_get nv1l_bit_get sames b64_encode b64_enc_char app ↻ app_js appn sys_mmap ↻ mp ↻ mpn sys_mmap ↻ sys_write ↻ sys_openat_wr sys_write ↻ sys_close ↻

structs

none

consts

12const K_MAGIC_32768: i64 = 32768
13const K_MAGIC_65536: i64 = 65536
14const K_MAGIC_16777216: i64 = 16777216
15const K_MAGIC_1000000007: i64 = 1000000007
16const K_MAGIC_524288: i64 = 524288
17const K_MAGIC_4194304: i64 = 4194304
19const OUTP: *u8 = "web_assets/listen_index.html"

functions

21func mp(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 2: emit_trackmain calls 1: sys_write
22func mpn(v: i64) -> i64
called by 2: emit_trackmain calls 2: sys_mmapsys_write
30func app(out: *u8, off: *i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ out[off[0]]=s[i]; off[0]=off[0]+1; i=i+1 } return 0 }
called by 2: emit_trackmain
33func app_js(out: *u8, off: *i64, s: *u8) -> i64
called by 1: emit_track
44func appn(out: *u8, off: *i64, v: i64) -> i64
called by 1: emit_track calls 1: sys_mmap
50func read_file(path: *u8, buf: *u8, cap: i64) -> i64
56func i16(b: *u8, off: i64) -> i64 { var v: i64=(b[off]&0xff)+((b[off+1]&0xff)*256); if v>=K_MAGIC_32768 { v=v-K_MAGIC_65536 } return v }
called by 1: emit_track
57func iabs(v: i64) -> i64 { if v<0 { return 0-v } return v }
called by 1: emit_track
58func sames(a: *u8, b: *u8, n: i64) -> i64 { var i: i64=0; while i<n { if a[i]!=b[i] { return 0 } i=i+1 } return 1 }
called by 1: emit_track
62func emit_track(out: *u8, off: *i64, id: *u8, title: *u8, desc: *u8, wavpath: *u8,
112func main() -> i64