A robust Python CLI tool to split .m4b audiobooks into individual files by chapter.
- Formats: Support for
mp3(default),aac,flac. - Meta-data Preserved: Track titles and numbers are set in the output files.
- Auto-Bitrate: Automatically detects the bitrate of the source file to match quality (or specify your own).
- Organized Output: Creates a folder named after the Album (or filename) containing the split files.
-
Ensure
ffmpegis installed on your system:brew install ffmpeg # macOS sudo apt install ffmpeg # Ubuntu/Debian
-
Create a virtual environment and install dependencies:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt -
Or install directly from Git:
pip install git+https://github.com/ShinChven/splitm4b.git
Run the tool from the project root:
# Basic usage (defaults to mp3, auto-bitrate)
splitm4b /path/to/audiobook.m4b--format, -f: Output format. Choices:mp3,aac,flac. Default:mp3.--bitrate, -b: Audio bitrate (e.g.,128k,192k). If omitted, tries to match source.
Convert to FLAC:
splitm4b my_book.m4b --format flacConvert to MP3 with specific bitrate:
splitm4b my_book.m4b --bitrate 64kThis project is licensed under the terms of the MIT License.