code wiki / _hdl_build / nx_audio_book.nx

nx_audio_book.nx

buildroot/runtime/_hdl_build/nx_audio_book.nx

6510 B105 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic audio
docsdependenciesstructsconstsfunctions

about

nx_audio_book.nx -- SOVEREIGN audiobook/audio (MP3 + ID3v2) -> Nishi format. Operator goal: liberate purchased audiobooks (the operator's ~153 audiobook files) into the owned .nmz, as the @kind=audio media kind. Reads the ID3v2.3/2.4 tag (TIT2 title, TPE1 artist/narrator, TALB album) and CARRIES the audio bytes through unchanged (the browser/player plays MP3 last-mile -- no codec to build, container unifies + codec specializes). Emits the audio.json manifest (with "file":"X" track entries, the same convention book.json/cbx.json use) + track0.mp3, so nx_nmz_pack packs it into .nmz @kind=audio. Rung 1: single MP3 -> one track; multi-file audiobook zips + M4B (MP4 atoms) + per-chapter splitting = next rungs. LEGAL LINE: liberates DRM-FREE audio; no DRM circumvention. Usage: nx_audio_book <mp3-path> <slug>. expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_audio_book.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 do_audio sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ab_p ab_w sys_write ab_slen be32 id4eq frame_text ensure_dir er_cat sys_openat_wr sys_write ↻ sys_close ↻ ab_w ↻ er_wjson sys_write ↻ ab_n nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap ab_pn ab_n ↻ ab_p ↻ sys_exit

structs

none

consts

11const K_MAGIC_1024: i64 = 1024

functions

13func ab_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: ab_w
14func ab_w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, ab_slen(s)); return 0 }
called by 2: ab_pdo_audio calls 2: sys_writeab_slen
19func ab_n(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 }
called by 2: ab_pndo_audio calls 1: nxi_fd
20func ab_p(s: *u8) -> i64 { ab_w(1, s); return 0 }
called by 2: do_audiomain calls 1: ab_w
21func ab_pn(v: i64) -> i64 { ab_n(1, v); return 0 }
called by 1: do_audio calls 1: ab_n
22func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 }
called by 1: do_audio
23func er_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: do_audio
24func be32(b: *u8, o: i64) -> i64 { return ((b[o] as i64)<<24)|((b[o+1] as i64)<<16)|((b[o+2] as i64)<<8)|(b[o+3] as i64) }
called by 1: do_audio
25func er_wjson(fd: i64, s: *u8) -> i64
called by 1: do_audio calls 1: sys_write
30func id4eq(z: *u8, p: i64, id: *u8) -> i64 { var k: i64=0; while k<4 { if z[p+k]!=id[k] { return 0 } k=k+1 } return 1 }
called by 1: do_audio
33func frame_text(z: *u8, off: i64, flen: i64, out: *u8, cap: i64) -> i64
called by 1: do_audio
39func do_audio(path: *u8, slug: *u8) -> i64
98func main(argc: i64, argv: *i64) -> i64