Turn a folder of audio chapters into a single .m4b audiobook for Apple Books.
The converter keeps chapters in the correct order, adds chapter markers and book details, and embeds a cover image when one is available. Your original audio files are never changed or deleted.
- Combine many chapter files into one M4B audiobook
- Create chapter markers using the original filenames
- Sort numbered files correctly (
2comes before10) - Add a title, author, audiobook genre, and cover image
- Show progress while the audiobook is being created
- Work with AAC, AIFF (
.aifand.aiff), FLAC, M4A, MKA, MP3, OGG, OPUS, WAV, and WMA files - Mix supported audio formats in the same folder
- Preserve stereo audio
- Refuse to overwrite an existing audiobook
You need:
- macOS
- Node.js 18 or newer
- FFmpeg
The easiest way to install everything is with Homebrew:
brew install node ffmpeg
Install the converter from npm:
npm install --global audiobook-converter
You can now use audiobook-convert from any folder in Terminal.
To check that it is installed:
audiobook-convert --version
Put all chapter files directly inside one folder. Their filenames determine their order and chapter titles.
My Audiobook/
├── 01 - Introduction.opus
├── 02 - The First Day.opus
├── 03 - A New Discovery.mp3
└── cover.jpg
Numbered files are sorted naturally, so 1, 2, and 10 appear in that
order. A leading number and separator are removed from the chapter title:
01 - Introduction.opus → Introduction
02. The First Day.mp3 → The First Day
03_A New Discovery.wav → A New Discovery
Pass the folder to the command:
audiobook-convert "/Users/me/Downloads/My Audiobook"Quotes are recommended when a path contains spaces.
The finished M4B is created next to the input folder:
Downloads/
├── My Audiobook/
└── My Audiobook.m4b
Drag the .m4b file into Apple Books or use File → Import in the Books app.
Use --title and --author to set the information shown in Apple Books:
audiobook-convert \ "./Harry Potter 1" \ --title "Harry Potter and the Philosopher's Stone" \ --author "J. K. Rowling"
If no title is provided, the input folder name is used. If no author is
provided, the audiobook uses Unknown Author.
When no cover is specified, the converter automatically looks inside the audiobook folder for these filenames:
cover.jpg
cover.jpeg
cover.png
folder.jpg
folder.png
You can choose another image with --cover:
audiobook-convert "./My Audiobook" --cover "./artwork.png"
JPG and PNG images are supported. The image is embedded inside the finished M4B, so the separate cover file is not needed afterward.
Use --output or -o to choose where the audiobook is saved:
audiobook-convert \ "./My Audiobook" \ --output "/Users/me/Desktop/My Audiobook.m4b"
The .m4b extension is added automatically when omitted. Existing files are
never replaced; choose a different output path or move the old file first.
The default AAC bitrate is 96k, which is a good balance for spoken audio.
Use --bitrate if you prefer a different value:
audiobook-convert "./My Audiobook" --bitrate 128kA higher bitrate can improve quality but creates a larger file.
audiobook-convert \ "/Users/me/Downloads/Upgrade" \ --title "Upgrade" \ --author "Blake Crouch" \ --cover "/Users/me/Downloads/Upgrade/cover.jpg" \ --bitrate 128k \ --output "/Users/me/Downloads/Blake Crouch - Upgrade.m4b"
| Option | Purpose |
|---|---|
--title "Book Title" |
Set the audiobook title |
--author "Author Name" |
Set the author |
--cover path/to/image.jpg |
Choose a JPG or PNG cover |
--output path/to/book.m4b |
Choose the output file |
-o path/to/book.m4b |
Short form of --output |
--bitrate 128k |
Choose the AAC bitrate; default is 96k |
--verbose or -v |
Show more details when diagnosing a problem |
--help or -h |
Show command help |
--version |
Show the installed version |
Install FFmpeg and try again:
brew install ffmpeg
Make sure the chapter files:
- use one of the supported formats listed above
- are directly inside the selected folder, not inside subfolders
- have normal audio file extensions such as
.opus,.mp3, or.m4a
The converter will not overwrite an audiobook. Move or rename the existing
file, or choose another path with --output.
The file may be damaged or use an unsupported variation. Run the command again
with --verbose to see which file caused the problem:
audiobook-convert "./My Audiobook" --verboseApple Books may remember details from an older import. Remove the old copy from Books, then import the new M4B again.
npm uninstall --global audiobook-converter
To work on the project locally, clone the repository and install its dependencies with pnpm:
git clone https://github.com/birosrichard/audiobook-converter.git cd audiobook-converter pnpm install pnpm test pnpm link --global
MIT