code wiki / _hdl_build / nx_audio_render.nx

nx_audio_render.nx

buildroot/runtime/_hdl_build/nx_audio_render.nx

8706 B102 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic audio
docsdependenciesstructsconstsfunctions

about

nx_audio_render.nx -- SOVEREIGN ZERO-JS audiobook player PAGE (rung 1 of SC33-37). Operator's correction: the player features are NISHI CODE, not browser JS -- the player BRAIN is a server-side Nishi audio daemon (nx_audio_serve, next rung) + our own DSP pre-rendering; the browser is a dumb NATIVE <audio> client. So "browser runs ZERO code" holds (same doctrine as the zero-JS text reader). This emits the static player HTML from reader/<slug>/audio.json: native <audio controls> (SC33 basic playback + the browsers' native speed menu) + chapters + the daemon-API affordances (speed-variant / sleep-timer / bookmark links+forms that target the Nishi daemon -- the "APIs" that do the work server-side). FAIL-CLOSED: scans its OWN bytes for <script and REFUSES to emit any (sovereign zero-JS, like nx_reader_render). Usage: nx_audio_render <slug>. expect_exit: 0 ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_audio_render.nx

imports: nx_syscalls.nxnx_itoa_lib.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 cat sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ar_p sys_write ar_slen sys_exit jval jfrom ar_slen ↻ ar_slen ↻ aw awh aw ↻ contains ar_slen ↻ sys_openat_wr sys_write ↻ sys_close ↻ ar_pn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap

structs

none

consts

11const K_MAGIC_1024: i64 = 1024
12const K_MAGIC_65536: i64 = 65536

functions

14func ar_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
15func ar_p(s: *u8) -> i64 { sys_write(1, s, ar_slen(s)); return 0 }
called by 1: main calls 2: sys_writear_slen
20func ar_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
21func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 }
22func cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off+i]=s[i];i=i+1} return off+i }
called by 1: main
23func aw(o: *u8, p: *i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ o[p[0]]=s[i]; p[0]=p[0]+1; i=i+1 } return 0 }
called by 2: awhmain
25func awh(o: *u8, p: *i64, s: *u8) -> i64
called by 1: main calls 1: aw
32func jfrom(hay: *u8, hl: i64, start: i64, needle: *u8) -> i64
called by 1: jval calls 1: ar_slen
39func jval(hay: *u8, hl: i64, key: *u8, out: *u8, cap: i64) -> i64
called by 1: main calls 2: jfromar_slen
47func contains(hay: *u8, hl: i64, needle: *u8) -> i64
called by 1: main calls 1: ar_slen
54func main(argc: i64, argv: *i64) -> i64