code wiki / _hdl_build / nx_listen_player.nx
nx_listen_player.nx
buildroot/runtime/_hdl_build/nx_listen_player.nx
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
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
structs
| none |
consts
| 12 | const K_MAGIC_32768: i64 = 32768 |
| 13 | const K_MAGIC_65536: i64 = 65536 |
| 14 | const K_MAGIC_16777216: i64 = 16777216 |
| 15 | const K_MAGIC_1000000007: i64 = 1000000007 |
| 16 | const K_MAGIC_524288: i64 = 524288 |
| 17 | const K_MAGIC_4194304: i64 = 4194304 |
| 19 | const OUTP: *u8 = "web_assets/listen_index.html" |
functions
| 21 | func mp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 22 | func mpn(v: i64) -> i64 |
| 30 | func 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 } |
| 33 | func app_js(out: *u8, off: *i64, s: *u8) -> i64 called by 1: emit_track |
| 44 | func appn(out: *u8, off: *i64, v: i64) -> i64 |
| 50 | func read_file(path: *u8, buf: *u8, cap: i64) -> i64 |
| 56 | func 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 |
| 57 | func iabs(v: i64) -> i64 { if v<0 { return 0-v } return v } called by 1: emit_track |
| 58 | func 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 |
| 62 | func emit_track(out: *u8, off: *i64, id: *u8, title: *u8, desc: *u8, wavpath: *u8, |
| 112 | func main() -> i64 |