abook is a Bash script function that automates the process of merging multiple .mp3 files in the current directory into a single .m4b audiobook file. It uses ffmpeg and temporary file management for a streamlined experience.
- Automatically combines all
.mp3files in the current directory - Outputs a
.m4bfile named after the current folder - Temporary files are automatically cleaned up
- Simple help menu with
-hor--helpoption
bashffmpeggmktemp(GNUmktempor equivalent for temporary files)
You can source the script or add the function to your .bashrc/.bash_profile:
source /path/to/abook.shNavigate to a folder containing MP3 files:
cd /path/to/mp3/files
abookThis will create a file called foldername.m4b in the same directory.
abook -hDisplays usage instructions.
The script automatically deletes all temporary files it creates when it finishes or exits unexpectedly.
Suppose you have a directory /audiobooks/MyBook with:
01_intro.mp3
02_chapter1.mp3
03_chapter2.mp3
Running abook in that directory creates:
MyBook.m4b
This project is licensed under the terms of the GNU General Public License v3.0.