Generate line-level .lrc and .srt lyric files from audio and reference lyrics
Project description
AutoLRC
AutoLRC generates line-level .lrc and .srt files from an audio file and a reference
lyrics .txt file. A .json report is optional and is only written when --json-report
is passed. LRC metadata applies only to the generated .lrc; source .wav and .mp3
files are not modified.
Primary release fixture:
- audio:
tests/fixtures/Major Revision.wav - lyrics:
tests/fixtures/Major Revision.txt
Setup
Create a virtual environment, make sure ffmpeg is on PATH, then install one dependency
set.
python3.12 -m venv .venv
. .venv/bin/activate
.venv/bin/python -m pip install --upgrade pip
# GPU
.venv/bin/python -m pip install torch --index-url https://download.pytorch.org/whl/cu128
.venv/bin/python -m pip install -e .[gpu,dev]
# CPU
.venv/bin/python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
.venv/bin/python -m pip install -e .[cpu,dev]
Check the runtime:
.venv/bin/autolrc doctor
Single File
Basic run:
.venv/bin/autolrc align --audio "tests/fixtures/Major Revision.wav" --lyrics "tests/fixtures/Major Revision.txt"
Useful options:
--title,--artist,--lang: add[ti],[ar], and[la]tags to the generated.lrc--json-report: also write the sibling.jsonreport--separator-boost: align on a separated vocal stem--save-vocals: keep the sibling.vocals.wavfile
Examples:
.venv/bin/autolrc align --audio "tests/fixtures/Major Revision.wav" --lyrics "tests/fixtures/Major Revision.txt" --title "Major Revision" --artist "PiPi" --lang en
.venv/bin/autolrc align --audio "tests/fixtures/Major Revision.wav" --lyrics "tests/fixtures/Major Revision.txt" --json-report
.venv/bin/autolrc align --audio "tests/fixtures/Major Revision.wav" --lyrics "tests/fixtures/Major Revision.txt" --separator-boost --save-vocals
Defaults:
- engine:
stable-ts - model:
medium - device:
auto - separator:
none - outputs: sibling
.lrcand.srt
If a stable-ts run finishes with average_confidence < 0.5, inspect the output first and
consider rerunning with --separator-boost.
Batch Mode
If --audio points to a directory, AutoLRC switches into batch mode.
.venv/bin/autolrc align --audio tests/fixtures --engine baseline
.venv/bin/autolrc align --audio tests/fixtures --artist "PiPi" --json-report --engine baseline
Batch rules:
- search only the given directory, not subdirectories
- match same-stem
.wavor.mp3files with a sibling.txt - prefer
.wavwhen both.wavand.mp3exist for one stem - continue after per-track failures
- exit with code
1if any matched track fails or if no valid pairs are found
Batch metadata:
--titleand--langare rejected--artistis allowed- when
--artistis provided, each generated.lrcgets[ar:<artist>]and[ti:<file-stem>] - when
--artistis omitted, batch.lrcfiles stay metadata-free
Per-track outputs:
- default:
song.lrc,song.srt - with
--json-report: alsosong.json - with
--save-vocals: alsosong.vocals.wav
Release Checks
Run these before publishing to PyPI:
.venv/bin/python -m pytest -q
.venv/bin/python -m ruff check src tests
.venv/bin/python -m pre_commit run --all-files
.venv/bin/python -m build
.venv/bin/python -m twine check dist/*
.venv/bin/python -m autolrc benchmark --manifest bench/manifest.yaml
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
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 autolrc_tools-0.2.0.tar.gz.
File metadata
- Download URL: autolrc_tools-0.2.0.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
deb70fbccaac52806975cc3fec0f548c63be9ae9ace43266809b5d3fd877a540
|
|
| MD5 |
e1ee7c96241ad22ec083dda8915cc503
|
|
| BLAKE2b-256 |
fe483758cdc9fea3915f477b78d76d7f49b52bdb3ba036ad2e2a6a14aa9a404b
|
File details
Details for the file autolrc_tools-0.2.0-py3-none-any.whl.
File metadata
- Download URL: autolrc_tools-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2586ff0c81978993c5a1e85d5ee4e9cdea12dfa4e682823a3e81e94d1e27d73
|
|
| MD5 |
6446864874927e97a6535c1d1d256540
|
|
| BLAKE2b-256 |
29c38a37ed8afc141c8178868ecf78b6ce115144df6a1b14f53c90f2a08dcf54
|