A Go-based command-line tool for processing and manipulating M4B audiobook files. This tool helps you manage, merge, and process audio files specifically for audiobook formats.
The idea is to keep the original files as ripped from cd in a lossless codec while creating a lossily compressed m4b file for usage on phone etc. When there is an error in the metadata or chapters, you simply fix it in the narr.yml, rerun narr and get a new file with the corrected data.
narr uses a docker-compose like project-file named narr.yml
. It should be located on the root
of the directory containing the audio files of the audio book.
- Go to the base directory of your project
- Run
narr m4b generate
to create anarr.yml
. - Fill the narr.yml according to your use case.
- Run
narr m4b check
to check your changes without executing them. - When you're satisfied with the output, run
narr m4b run
. - Wenn the conversion is done, find your output file(s) in
~/narr/
The tool uses a YAML configuration file to define project settings. Here's an example configuration:
# Path to the cover image for the audiobook. Uses cover from the first audio file if empty.
coverPath: ""
# Whether to generate chapters from the audio files metadata titles
hasChapters: false
# manipulation of meta tags via regex (using go regex syntax)
metadataRules:
- tag: album
type: regex
regex: "Folge (\\d): (.*)"
format: "Folge 00%s: %s"
- tag: album
type: regex
regex: "Folge (\\d\\d): (.*)"
format: "Folge 0%s: %s"
- tag: album
type: regex
regex: "Folge (\\d+): (.*)"
format: "%s. %s"
# rules to map title tags into chapters (same continuous title = no new chapter)
chapterRules:
- pattern: "Chapter \\d+"
format: "Chapter %d"
chapterRules: []
shouldConvert: true
multi: true
# Whether to convert audio files into aac before concatenating them
shouldConvert: true
- Go 1.16 or higher
- FFmpeg installed on your system
make install