Transcribe (whisper) and translate (gpt) voice into LRC file.
Project description
Open-Lyrics
Open-Lyrics is a Python library that transcribes voice files using
faster-whisper, and translates/polishes the resulting text
into .lrc
files in the desired language using OpenAI-GPT.
This new project is rapidly underway, and we welcome any issues or pull requests.
Installation
-
Please install CUDA and cuDNN first according to https://opennmt.net/CTranslate2/installation.html to enable
faster-whisper
. -
Add your OpenAI API key to environment variable
OPENAI_API_KEY
. -
This project can be installed from PyPI:
pip install openlrc
or install directly from GitHub:
pip install git+https://github.com/zh-plus/Open-Lyrics
Usage
from openlrc import LRCer
lrcer = LRCer()
lrcer('./data/test.mp3', target_lang='zh-cn') # Generate translated ./data/test.lrc with default translate prompt.
# lrcer('./data/test.mp3', prompter='lovely_trans') # Generate ./data/test.lrc with lovely colloquial expressions.
Todo
- Batched translate/polish for GPT request (enable contextual ability).
- Concurrent support for both whisper model and GPT request.
- Whisper
- GPT
- Automatically fix json encoder error using GPT.
- Make translate prompt more robust.
- Add local LLM support.
- Add transcribed examples.
- Song
- Podcast
- Audiobook
Credits
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
openlrc-0.0.5.tar.gz
(21.8 kB
view hashes)
Built Distribution
openlrc-0.0.5-py3-none-any.whl
(13.9 kB
view hashes)