Skip to main content

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

  1. Please install CUDA and cuDNN first according to https://opennmt.net/CTranslate2/installation.html to enable faster-whisper.

  2. Add your OpenAI API key to environment variable OPENAI_API_KEY.

  3. Install whisperx

    pip install git+https://github.com/m-bain/whisperx.git
    
  4. 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 GPT request.
  • Use whisperx for transcription.
  • Make translate prompt more robust according to https://github.com/openai/openai-cookbook.
  • Automatically fix json encoder error using GPT.
  • Multiple output format support.
  • Add Azure OpenAI Service support.
  • Add local LLM support.
  • Add transcribed examples.
    • Song
    • Podcast
    • Audiobook

Credits

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

openlrc-0.1.0.tar.gz (29.9 kB view hashes)

Uploaded Source

Built Distribution

openlrc-0.1.0-py3-none-any.whl (16.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page