Skip to content

ostoc/audiobook-binder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Audiobook Binder

A web-based tool for converting audio files into M4B audiobook format, perfect for iOS Books and other audiobook players.

Audiobook Binder Preview

What This Project Does

Audiobook Binder transforms your audio files into properly formatted M4B audiobooks with:

  • Audio Conversion: Convert MP3, AAC, M4A, and M4B files to M4B format optimized for audiobooks
  • Metadata Embedding: Add title, author, narrator, and cover image to your audiobook
  • Chapter Support:
    • File-based chapters (each file becomes a chapter)
    • Auto-detection of chapters from silence patterns in audio
  • Multiple File Support: Merge multiple audio files into a single audiobook
  • Drag & Drop Interface: Reorder files with an intuitive drag-and-drop UI
  • Real-time Progress: Track conversion progress with live updates

Requirements

  • Python 3.x
  • FFmpeg - Required for audio processing and conversion
  • Flask - Web framework (installed via pip)

Installing FFmpeg

macOS (using Homebrew):

brew install ffmpeg

Ubuntu/Debian:

sudo apt update && sudo apt install ffmpeg

Windows: Download from ffmpeg.org and add to your PATH.

Setup

  1. Clone the repository:

    git clone <repository-url>
    cd audiobook-binder
  2. Create a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install flask

Running the Project

  1. Start the Flask server:

    python app.py
  2. Open your browser and navigate to:

    http://127.0.0.1:5000
    
  3. Using the application:

    • Add a cover image for your audiobook
    • Enter book metadata (title, author, narrator)
    • Upload one or more audio files
    • Optionally enable auto chapter detection to detect chapters from silence
    • Click "Convert to .m4b" and download your audiobook

Project Structure

audiobook-builder/
├── app.py              # Flask application with conversion logic
├── static/
│   ├── css/
│   │   └── styles.css  # Application styles
│   └── js/
│       └── app.js      # Alpine.js application logic
├── templates/
│   └── index.html      # Web interface template
├── uploads/            # Temporary upload storage
├── outputs/            # Generated M4B files
└── README.md

Frontend Architecture

The frontend uses Alpine.js for reactive state management:

  • Declarative bindings: x-model, x-show, x-for for automatic UI updates
  • Event handling: @click, @change, @dragover for user interactions
  • Reactive state: Automatic UI updates when data changes
  • SortableJS: Drag-and-drop file reordering (integrated with Alpine.js)

No build step required - Alpine.js is loaded via CDN.

License

MIT License

About

A web-based tool for converting audio files into M4B audiobook format, perfect for iOS Books and other audiobook players.

Resources

Stars

Watchers

Forks

Contributors