code wiki / _hdl_build / nx_audio_book.nx
nx_audio_book.nx
buildroot/runtime/_hdl_build/nx_audio_book.nx
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
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
structs
| none |
consts
| 11 | const K_MAGIC_1024: i64 = 1024 |
functions
| 13 | func 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 |
| 14 | func ab_w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, ab_slen(s)); return 0 } |
| 19 | func ab_n(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 20 | func ab_p(s: *u8) -> i64 { ab_w(1, s); return 0 } |
| 21 | func ab_pn(v: i64) -> i64 { ab_n(1, v); return 0 } |
| 22 | func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 } called by 1: do_audio |
| 23 | func 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 |
| 24 | func 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 |
| 25 | func er_wjson(fd: i64, s: *u8) -> i64 |
| 30 | func 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 |
| 33 | func frame_text(z: *u8, off: i64, flen: i64, out: *u8, cap: i64) -> i64 called by 1: do_audio |
| 39 | func do_audio(path: *u8, slug: *u8) -> i64 |
| 98 | func main(argc: i64, argv: *i64) -> i64 |