Skip to main content

Bilingual audiobook interleaver

Project description

Bilbo

Bilingual audiobook interleaver. Takes two audiobooks of the same book in different languages and creates a single audiobook that alternates between them sentence-by-sentence.

Example

From The Alloy of Law by Brandon Sanderson (English + German):

https://github.com/user-attachments/assets/aff6c1cb-6f67-43a8-bc9f-3fd6ab3a5c8a

EN: The revolver was nothing fancy to look at, though the six-shot cylinder was machined with such care in the steel alloy frame that there was no play in its movement.

DE: Der Revolver machte zwar keinen besonders ansehnlichen Eindruck, doch die sechsschüssige Trommel war mit solcher Präzision in den Rahmen aus einer Stahllegierung eingesetzt, dass in ihren Bewegungen nicht das geringste Spiel war.


EN: There was no gleam to the metal or exotic material on the grip, but it fit his hand like it was meant to be there.

DE: Das Metall schimmerte nicht und in den Griff waren keinerlei exotische Materialien eingelassen, aber die Waffe lag so gut in seiner Hand, als wäre sie eigens dafür geschaffen worden.


EN: The waist-high fence was flimsy, the wood grayed with time, held together with fraying lengths of rope.

DE: Der hüfthohe Zaun war baufällig, das Holz, mit der Zeit grau geworden, wurde von ausgefransten Seilen zusammengehalten.

How it works

  1. Transcription — Speech-to-text via faster-whisper with word-level timestamps
  2. Segmentation — Sentence boundary detection via pySBD
  3. Alignment — Cross-lingual sentence matching using LaBSE embeddings via sentence-transformers
  4. Assembly — Audio normalization/extraction/interleaving via ffmpeg
  5. Metadata — Cover art + text metadata merging (optionally via local LLM with ollama)

Prerequisites

  • Python 3.10+
  • uv package manager
  • ffmpeg and ffprobe on PATH
  • CUDA-capable GPU recommended (CPU works but is much slower)

Installation

git clone https://github.com/xiaoxiae/Bilbo
cd Bilbo
uv sync

Usage

Process a book

bilbo process \
  --l1-audio en.mp3 \
  --l2-audio de.mp3 \
  --l1-lang en \
  --l2-lang de \
  --title "My Book"

This runs the full pipeline (transcribe, segment, align, export) and stores results in ~/.bilbo/books/<slug>/.

Library management

bilbo list              # List all books
bilbo info <slug>       # Show details about a book
bilbo delete <slug>     # Delete a book

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bilbo_audiobook-0.1.0.tar.gz (153.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bilbo_audiobook-0.1.0-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file bilbo_audiobook-0.1.0.tar.gz.

File metadata

  • Download URL: bilbo_audiobook-0.1.0.tar.gz
  • Upload date:
  • Size: 153.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bilbo_audiobook-0.1.0.tar.gz
Algorithm Hash digest
SHA256 27bbca003c74742e734793141a039ff7046bc62ba8a6bf3a5911be8c4c12dfae
MD5 21a87a5cd2a5f39c3e6d184740b03663
BLAKE2b-256 3c3f393d6159baddc5c882382ef89300116ef726488a658f237ef802888307b1

See more details on using hashes here.

File details

Details for the file bilbo_audiobook-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bilbo_audiobook-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bilbo_audiobook-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f084d12733096c9797b97c6b99512982e16f61a66069b16b00a5e35e1cb0eb22
MD5 f1412710b95d42d718d20e34aa015340
BLAKE2b-256 51e39c6c60ca4631bdbecafec91b8a42f1e0665a2950db0b87988c9ffc9ee4f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page