BPM4B v12 — Professional Multimedia Processing Suite
Convert MP3 ↔ M4B · Generate AI Audiobooks · Process Documents to Audio · Create EPUBs · Edit Metadata
pip install bpm4b
bpm4b web # Start web interface at http://localhost:5000
What's New in v12
| Version | Feature |
|---|---|
| v12 | ⚡ Audio Format Converter (MP3/WAV/FLAC/AAC/OGG/ALAC) · Metadata Editor with Open Library Lookup · Document to EPUB · Audio Glue (Batch Merge) · Folder to M4B · EPUB to Audiobook · Health Check · SSE Progress Tracking |
| v11 | ✍️ Interactive Pro Editor · Neural Narration Studio · Multi-voice dialogue |
| v10 | 📚 M4B → MP3 · Document to Audiobook · Kokoro-82M TTS |
Installation
PyPI
pip install bpm4b
TTS Support (optional)
# Standard Kokoro (recommended)
pip install bpm4b[tts]
# ONNX variant
pip install bpm4b[tts-onnx]
# All extras
pip install bpm4b[all]
FFmpeg
FFmpeg is required and must be installed separately:
- Windows: Download from https://www.gyan.dev/ffmpeg/builds/ and add to PATH
- macOS:
brew install ffmpeg - Linux:
sudo apt-get install ffmpeg
Usage
Web Interface
bpm4b web # Start at http://localhost:5000
bpm4b web --port 8080 # Custom port
bpm4b web --host 127.0.0.1 # Custom host
CLI — MP3 ↔ M4B
bpm4b convert input.mp3 output.m4b # Basic
bpm4b convert input.mp3 output.m4b --quality 128k # Custom quality
bpm4b convert input.mp3 output.m4b --chapter "Intro" 0 --chapter "Ch1" 300 # With chapters
bpm4b convert input.m4b output.mp3 # M4B to MP3
CLI — Audiobook Generation
bpm4b audiobook book.pdf book.m4b # PDF to audiobook
bpm4b audiobook book.docx book.m4b --voice af_bella # Custom voice
bpm4b audiobook book.epub book.m4b --speed 1.25 # Faster playback
bpm4b audiobook book.txt book.m4b --preview # Preview chapters only
CLI — EPUB Creation
bpm4b epub book.pdf book.epub # PDF to EPUB
bpm4b epub book.docx book.epub --title "My Book" --author "Me" # With metadata
bpm4b epub index.html book.epub # HTML to EPUB
CLI — Audio Merge (Glue)
bpm4b audio-glue intro.mp3 chapter1.mp3 chapter2.mp3 book.m4b # Merge files
bpm4b audio-glue *.mp3 book.m4b --normalize # With normalization
bpm4b audio-glue a.mp3 b.mp3 out.m4b --volume 1.5 # Boost volume
CLI — Health Check
bpm4b health
Features
🔄 MP3 ↔ M4B Conversion
- MP3 → M4B with embedded chapter markers
- M4B → MP3 high-fidelity extraction
- Custom audio quality (64k–256k)
- Chapter timestamps in seconds or MM:SS format
🎙️ AI Audiobook Generation
- Powered by Kokoro-82M Local TTS engine (no API key needed)
- 50+ voices across 9 languages
- Adjustable speed (0.5x–2.0x)
- Automatic chapter detection
- Support for PDF, DOCX, TXT, EPUB, MD
🔊 Audio Format Converter
- Convert between MP3, WAV, FLAC, AAC, OGG, ALAC
- Configurable bitrate and quality settings
- Lossless options for FLAC and WAV
📖 Document to EPUB
- Convert PDF, DOCX, TXT, MD, HTML, RTF to EPUB
- Automatic chapter detection and splitting
- Custom metadata (title, author, language)
- Styled XHTML output with CSS
🏷️ Metadata Editor
- Extract metadata from M4B/M4A files
- Edit title, author, genre, description
- Embed cover art
- Lookup metadata from Open Library
🔀 Batch Merge (Audio Glue)
- Merge multiple audio files into one
- Optional loudness normalization
- Volume adjustment
- Seamless gapless concatenation
📁 Folder to M4B
- Batch convert entire folders of audio files
- Auto-generated chapter markers from filenames
- Parallel processing support
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/convert |
POST | Unified MP3↔M4B conversion |
/api/mp3-to-m4b |
POST | Explicit MP3 → M4B |
/api/generate-audiobook |
POST | Document to audiobook via TTS |
/api/audiobook |
POST | Full chapter-aware audiobook pipeline |
/api/epub-to-audiobook |
POST | EPUB to narrated audiobook |
/api/document-to-epub |
POST | Convert document to EPUB |
/api/convert-audio |
POST | Audio format conversion |
/api/audio-glue |
POST | Merge multiple audio files |
/api/metadata/extract |
POST | Extract metadata from M4B/M4A |
/api/metadata/apply |
POST | Apply metadata to M4B/M4A |
/api/metadata/lookup |
POST | Lookup metadata from Open Library |
/api/preview-chapters |
POST | Preview chapter detection |
/api/voices |
GET | List available TTS voices |
/api/health |
GET | System health check |
/api/cleanup |
POST | Clean old uploaded/output files |
Requirements
- Python 3.8+
- FFmpeg (required for all audio operations)
- Kokoro (optional, for TTS/audiobook generation)
Project Structure
bpm4b/
├── bpm4b/
│ ├── __init__.py # Package metadata (v12.0.0)
│ ├── app.py # Flask web application (all endpoints)
│ ├── cli.py # Command-line interface
│ ├── core.py # Core conversion functions
│ ├── audiobook_builder.py # Full audiobook pipeline
│ ├── chapter_detector.py # Chapter detection engine
│ ├── document_parser.py # Document parsing (PDF/DOCX/EPUB/TXT)
│ ├── document_to_epub.py # Document to EPUB converter
│ ├── metadata.py # Metadata extract/apply/lookup
│ ├── tts.py # TTS engine (Kokoro)
│ └── templates/
│ └── index.html # Web interface
├── setup.py # Package configuration
├── pyproject.toml # Build configuration
└── README.md # This file
License
MIT License — see LICENSE file for details.
Contact
- X (Twitter): @jdjchelp
- Issues: https://github.com/jdjchelp-jpg/bpm4b/issues
Metadata
Release files for bpm4b 12.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bpm4b-12.0.0.tar.gz | 41.5 kB | With provenance | Details for bpm4b-12.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bpm4b-12.0.0-py3-none-any.whl | Python 3 | none | any | Details for bpm4b-12.0.0-py3-none-any.whl |
Total release size: 84.7 kB
Release files / bpm4b-12.0.0.tar.gz
| Download URL | bpm4b-12.0.0.tar.gz |
|---|---|
| Size | 41.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ad421bb5191d516b183eef77b8c7dd4cc1c929e9c38daee6e9a62214d653ea0
|
|
BLAKE2b-256 checksum How to use checksums |
72136380c23d155757fa439a3638069c17d82a91acdfcd96362969e13480f071
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.
Transparency logRelease files / bpm4b-12.0.0-py3-none-any.whl
| Download URL | bpm4b-12.0.0-py3-none-any.whl |
|---|---|
| Size | 43.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf6aadb6f075354beed54be71274b9adc3cf2ddf37dcbf0b3399f6b2cc37c599
|
|
BLAKE2b-256 checksum How to use checksums |
0bfd652a2197193e38ea00176c3d870590bbcc35bf604cf6179cb8e9a5773918
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.
Transparency logSecurity for bpm4b 12.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for bpm4b-12.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.