AI-powered LRC generator with Whisper and LLM correction
Project description
lrcgen
AI-powered LRC generator using Whisper + optional LLM correction.
Install
pip install lrcgen
Requirements
- Offline transcription uses Whisper models (first run may download model files).
- Online correction requires
OPENAI_API_KEY(or a compatible API viaOPENAI_BASE_URL).
Usage
# batch
lrcgen input/ output/
lrcgen input/ output/ --offline
lrcgen input/ output/ --online
# single file
lrcgen --audio input/song.mp3 --output out.lrc --offline
# choose whisper model/language
lrcgen --audio input/song.mp3 --output out.lrc --offline --model small --language zh
# module entrypoint (same as lrcgen command)
python -m lrcgen --audio input/song.mp3 --output out.lrc --offline
# version
python -m lrcgen --version
Online config
Set env vars (e.g. via .env):
OPENAI_API_KEY=...OPENAI_BASE_URL=https://api.openai.com/v1(optional)OPENAI_MODEL=gpt-4o-mini(optional)
Library usage
from lrcgen.api import generate_lrc_sync
generate_lrc_sync("input/song.mp3", "out.lrc", mode="offline")
Project structure
genlrc/
README.md
pyproject.toml
music_to_lrc_batch.py
lrcgen/
__init__.py # package version
__main__.py # enables: python -m lrcgen
cli.py # argparse CLI entrypoint
api.py # stable library API (sync + async)
whisperer.py # Whisper transcription wrapper
corrector.py # optional LLM correction + guardrails
utils.py # time formatting + basic text cleaning
config.py # env/.env config (OPENAI_*, etc.)
input/ # optional local test inputs (not packaged)
output/ # optional local outputs (not packaged)
test/
test.py # small unittest suite
tools/
clean.py # removes dist/build/cache artifacts
.github/workflows/
ci.yml # CI build + checks
publish.yml # tag-based publish via PyPI Trusted Publishing (OIDC)
How it fits together:
- CLI:
lrcgen/cli.pyparses args and callslrcgen/api.py. - Core pipeline:
whisperer.pytranscribes audio →utils.pycleans →corrector.pyoptionally fixes lines → writes.lrc. - Configuration:
config.pyloads environment variables (and.envif present).
Features
- Offline Whisper transcription
- Optional LLM correction
- Simplified Chinese output
- Batch processing
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 lrcgen-0.1.2.tar.gz.
File metadata
- Download URL: lrcgen-0.1.2.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
414d79c221a01eb0f40d1ffba133fe339b8cdacdec381fbe9632d70a2a2a0808
|
|
| MD5 |
b1a55b055a94a97c9e5516e9e0739924
|
|
| BLAKE2b-256 |
bf725090c3903e852acfdae7f4d1c5f1c27a0db739e7f5c84fc0a19676fbca66
|
Provenance
The following attestation bundles were made for lrcgen-0.1.2.tar.gz:
Publisher:
publish.yml on lihan3238/genlrc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lrcgen-0.1.2.tar.gz -
Subject digest:
414d79c221a01eb0f40d1ffba133fe339b8cdacdec381fbe9632d70a2a2a0808 - Sigstore transparency entry: 833709167
- Sigstore integration time:
-
Permalink:
lihan3238/genlrc@b4fd7e3767d77779c42fdf91cd3efe683efc09d2 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/lihan3238
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b4fd7e3767d77779c42fdf91cd3efe683efc09d2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lrcgen-0.1.2-py3-none-any.whl.
File metadata
- Download URL: lrcgen-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa0bdfc362106cdcefe3a6d3b1bb9799e3fe6967d07b33ead7e26b97a1915c0f
|
|
| MD5 |
17209759f51ed0672568b9da02587df8
|
|
| BLAKE2b-256 |
7d81bf3a1614ff00d127c428a9e6f87b3465d523b1e9119ba7e89ca365280959
|
Provenance
The following attestation bundles were made for lrcgen-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on lihan3238/genlrc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lrcgen-0.1.2-py3-none-any.whl -
Subject digest:
aa0bdfc362106cdcefe3a6d3b1bb9799e3fe6967d07b33ead7e26b97a1915c0f - Sigstore transparency entry: 833709169
- Sigstore integration time:
-
Permalink:
lihan3238/genlrc@b4fd7e3767d77779c42fdf91cd3efe683efc09d2 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/lihan3238
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b4fd7e3767d77779c42fdf91cd3efe683efc09d2 -
Trigger Event:
push
-
Statement type: