Skip to main content

Generate line-level .lrc and .srt lyric files from audio and reference lyrics

Project description

AutoLRC

Generates line-level .lrc, .srt, and .vtt files from an audio file and a reference lyrics .txt.

Setup

Requires Python 3.12 and ffmpeg on PATH.

python3.12 -m venv .venv
. .venv/bin/activate
pip install --upgrade pip

# GPU (CUDA 12.8)
pip install torch --index-url https://download.pytorch.org/whl/cu128
pip install -e .[gpu,dev]

# CPU
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -e .[cpu,dev]

Verify the install:

autolrc doctor

Single File

autolrc align --audio song.wav --lyrics song.txt

Accepts .wav, .flac, or .mp3. Outputs song.lrc, song.srt, and song.vtt alongside the audio.

Key options:

Option Effect
--title, --artist Write [ti], [ar] tags to the LRC
--lang <code> Override language (default: auto-detected)
--enhanced-lrc Karaoke-style LRC with inline word-level timestamps
--skip-existing Skip the run if song.lrc already exists
--separator-boost Separate vocals before aligning (improves noisy tracks)
--save-vocals Keep the separated stem as song.vocals.wav
--json-report Write a song.json quality report
--model Whisper model size: base, small, medium (default), large-v3
--device auto (default), cuda, or cpu

The [la] tag is written automatically from the detected language; --lang overrides it.

If alignment finishes with average_confidence < 0.5, inspect the output and consider rerunning with --separator-boost.

Examples:

# With metadata tags
autolrc align --audio song.wav --lyrics song.txt --title "Song Name" --artist "Artist"

# Karaoke-style LRC with word timestamps
autolrc align --audio song.wav --lyrics song.txt --enhanced-lrc

# With vocal separation and quality report
autolrc align --audio song.wav --lyrics song.txt --separator-boost --save-vocals --json-report

Batch Mode

Pass a directory to --audio to process all matching pairs at once:

autolrc align --audio ./my-songs/
autolrc align --audio ./my-songs/ --recursive --skip-existing
autolrc align --audio ./my-songs/ --artist "Artist" --enhanced-lrc --json-report

Rules:

  • Matches same-stem .wav/.flac/.mp3 files with a sibling .txt; priority is .wav > .flac > .mp3
  • Non-recursive by default; use --recursive to walk subdirectories
  • Continues on per-track failures; exits with code 1 if any track fails
  • --skip-existing skips tracks whose .lrc already exists
  • --title and --lang are rejected; --artist is allowed
  • When --artist is given, each LRC gets [ar:<artist>] and [ti:<file-stem>]

Per-track outputs: song.lrc, song.srt, song.vtt, and optionally song.json, song.vocals.wav

Other Commands

autolrc inspect --lyrics song.txt   # Preview normalized lyric lines
autolrc doctor                      # Show runtime diagnostics
autolrc cache clear                 # Remove the local cache directory

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

autolrc_tools-0.3.0.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

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

autolrc_tools-0.3.0-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file autolrc_tools-0.3.0.tar.gz.

File metadata

  • Download URL: autolrc_tools-0.3.0.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for autolrc_tools-0.3.0.tar.gz
Algorithm Hash digest
SHA256 32cdbff1804609ca056e128381e09b7d2a4dcf84887d6a2cd91a05e04c78780b
MD5 a089a7257e08ec3e68d8b1ee5fcde53d
BLAKE2b-256 15561b9f853bd86f06020175cfe3658b0f8ae4e9f986e4fdaae33181592066d4

See more details on using hashes here.

File details

Details for the file autolrc_tools-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: autolrc_tools-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for autolrc_tools-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef19861002ddf4f932c4c2ebab8925a1b81fde4c0cf3634452930010b7dfbaa4
MD5 f168b3643ba1cdc41b830ff168df1f6d
BLAKE2b-256 8b084765d302a6acf584834588996ed1eec8dc8b6f3213e03aae8d4ccf8352af

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