code wiki / _hdl_build / nx_m4b_book.nx
nx_m4b_book.nx
buildroot/runtime/_hdl_build/nx_m4b_book.nx
about
nx_m4b_book.nx -- SOVEREIGN M4B / M4A / MP4 audiobook -> Nishi format (@kind=audio). The other common audiobook
container (iTunes/Audible-non-DRM). MP4 = a tree of atoms (size:u32be + type:4 + payload); iTunes metadata is at
moov/udta/meta/ilst/<©nam title|©ART artist/narrator|©alb album>/data. meta is a FULLBOX (4 version/flags bytes
before its children). Carries the audio bytes through unchanged (no codec) -> audio.json + track0.m4b -> .nmz.
Emits the SAME audio.json schema as nx_audio_book (rung 2 = unify both into one dispatching audio liberator).
LEGAL LINE: liberates DRM-FREE M4B; Audible .aax/.aaxc DRM would be detected + declined (not built yet -- M4B
itself is DRM-free). Usage: nx_m4b_book <m4b-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
| 10 | const K_MAGIC_1024: i64 = 1024 |
functions
| 12 | 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 |
| 13 | func ab_w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, ab_slen(s)); return 0 } |
| 18 | func ab_n(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 19 | func ab_p(s: *u8) -> i64 { ab_w(1, s); return 0 } |
| 20 | func ab_pn(v: i64) -> i64 { ab_n(1, v); return 0 } |
| 21 | func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 } called by 1: do_m4b |
| 22 | 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_m4b |
| 23 | 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: find_atom |
| 24 | func er_wjson(fd: i64, s: *u8) -> i64 |
| 29 | func atom_type_eq(z: *u8, o: i64, t: *u8) -> i64 { if z[o+4]!=t[0]{return 0} if z[o+5]!=t[1]{return 0} if z[o+6]!=t[2]{return 0} if z[o+7]!=t[3]{return 0} return 1 } |
| 31 | func find_atom(z: *u8, start: i64, end: i64, t: *u8, ps: *i64, pe: *i64) -> i64 |
| 45 | func mp4_value(z: *u8, ilst_s: i64, ilst_e: i64, t: *u8, out: *u8, cap: i64) -> i64 |
| 55 | func do_m4b(path: *u8, slug: *u8) -> i64 |
| 114 | func main(argc: i64, argv: *i64) -> i64 |