Convert audio to video with auto-generated karaoke subtitles
Project description
LyriChroma
A powerful tool to convert audio files into videos with auto-generated, synchronized, and highlighted subtitles (Karaoke style).
Features
- Auto Transcription: Uses
faster-whisperfor high-accuracy speech-to-text with word-level timestamps. - Dynamic Backgrounds: Moving multi-color gradient with selectable palettes (plasma/aurora effects).
- Karaoke Subtitles: Real-time highlighting of spoken words.
- Customizable: Adjust font size, color, highlight color, and position.
- Transcript Editing: Export transcripts to JSON for manual correction, then re-import to generate the perfect video.
Installation
This project is managed with uv.
# Install uv if you haven't (https://github.com/astral-sh/uv)
pip install uv
# Clone and sync dependencies
uv sync
Usage
Basic Usage
Convert audio to video with a black background:
uv run lyrichroma --input audio.mp3 --output video.mp4
Advanced Usage
1. Dynamic Background
Generate a video with a cool moving background:
uv run lyrichroma --input audio.mp3 --output video.mp4 --bg-type dynamic --bg-value aurora
Available palettes: aurora (default), sunset, ocean, cyberpunk, forest.
2. Transcript Editing Workflow
- Generate transcript JSON (skip video generation):
uv run lyrichroma --input audio.mp3 --save-transcript transcript.json
- Edit
transcript.jsonmanually. - Generate video from edited transcript:
uv run lyrichroma --input audio.mp3 --output video.mp4 --load-transcript transcript.json
3. Styling
Customize the subtitle appearance:
uv run lyrichroma \
--input audio.mp3 \
--output video.mp4 \
--font-size 60 \
--font-color "#FFFFFF" \
--highlight-color "#FF0000" \
--text-y 0.8
Arguments
| Argument | Description | Default |
|---|---|---|
--input, -i |
Input audio file path | Required |
--output, -o |
Output video file path | Optional |
--bg-type |
color, image, or dynamic |
color |
--bg-value |
Hex color (#000000), image path, or palette name (aurora, sunset, ocean, cyberpunk, forest) |
#000000 or aurora |
--model-size |
Whisper model size (tiny, base, large-v2, etc.) | base |
--save-transcript |
Path to save JSON transcript | None |
--load-transcript |
Path to load JSON transcript | None |
--font-size |
Subtitle font size | 40 |
--font-color |
Text color | white |
--highlight-color |
Highlight color for active word | yellow |
--text-y |
Vertical position (0.0=top, 1.0=bottom) | 0.8 |
Testing
Run unit tests:
uv run pytest
Advanced Configuration
Pluggable ASR
Lyrichroma supports a pluggable ASR architecture. By default, it uses faster-whisper.
You can implement your own ASR provider by subclassing lyrichroma.asr.base.ASRProvider and passing it to the Transcriber.
Development
- Install Dependencies:
uv sync - Run Tests:
uv run pytest - Format & Lint:
uv run ruff check . uv run black .
- Pre-commit Hooks:
Install hooks to automatically check code before committing:
uv run pre-commit install
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lyrichroma-0.1.0.tar.gz.
File metadata
- Download URL: lyrichroma-0.1.0.tar.gz
- Upload date:
- Size: 3.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6660201cb9ae0c1cf525d1dd41f3fab6e1556ce888f6b84600b6cf66da2b4e67
|
|
| MD5 |
12f224fd4be16d7d3399538281afc94a
|
|
| BLAKE2b-256 |
38b4f7f77295e515d9c6c22d0e520bea10ae3acc3743897351918995406fd2c1
|
File details
Details for the file lyrichroma-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lyrichroma-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a230725de9860c64bef413b389189b662cf3a1a5ae57cf792c2b16b4a4af7c2
|
|
| MD5 |
fcedce90541b646c449d69cf4978cd34
|
|
| BLAKE2b-256 |
87d4cbfacce2d5696d37ec0266c35109e95327779c091ead588ab3d30c47baa6
|