Skip to main content

README

Open In Colab

介绍

借助whisperx生成卡拉ok歌词所需的k轴ass文件。注意,生成的准确性与输入质量相关,请确保lrc文件的时间戳准确。此外,使用UVR5处理后的人声文件作为输入会得到更准确的时间戳。

使用

可以在windows本地使用或者在 Colab 中运行

需要准备输入:

  1. 音频
  2. lrc文件(需要以行为单位的时间戳)

之后在任意位置新建文件夹,放入这两个文件即可。

在 Colab 中运行

Open In Colab

选择运行时为 GPU,在默认工作文件夹内新建raw文件夹,之后将音频文件与lrc文件放入其中。依次执行单元格即可。

在本地运行

安装依赖

conda install pytorch==2.0.0 torchaudio==2.0.0 pytorch-cuda=11.8 -c pytorch -c nvidia
pip install git+https://github.com/m-bain/whisperx.git
pip install whisperx-karaoke

运行

例如文件被放置在了 ./raw/song1 文件夹内

python -m whisperx_karaoke ./raw/song1
# usage: __main__.py [-h] [--device DEVICE] [--language LANGUAGE] [--offset OFFSET] dir [dir ...]
# __main__.py: error: the following arguments are required: dir

等待后ass文件会被输出到同一目录内。

其他参数

  • --device DEVICE

    选择设备,默认为 cuda

  • --language LANGUAGE

    选择语言,默认为 ja

  • --offset OFFSET

    lrc 歌词的偏移量,默认为 0

Q&A

Q: 为什么命令行会长时间卡住? A:whisperx 会尝试连接 huggingface,如果网络连接状况不好,请尝试为命令行设置代理。如windows powershell $Env:http_proxy="http://127.0.0.1:7890";$Env:https_proxy="http://127.0.0.1:7890"

Metadata

Release files for whisperx-karaoke 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whisperx-karaoke 0.1.1
File Size Uploaded
whisperx_karaoke-0.1.1.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for whisperx-karaoke 0.1.1
File Interpreter ABI Platform
whisperx_karaoke-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.6 kB

Release files / whisperx_karaoke-0.1.1.tar.gz

Download URL whisperx_karaoke-0.1.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d5d6b37929eac5276a4c476f5d3f2c0b762effa9848ba7547680a98d03f112fc
BLAKE2b-256 checksum
How to use checksums
fc6b60941dd2529eb78a27d631d43496b852d25b99f24019e93439f55cee1d21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.14

Release files / whisperx_karaoke-0.1.1-py3-none-any.whl

Download URL whisperx_karaoke-0.1.1-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7d75b0f5f72d1a248bfba3e132994e26870070d0dda853c84457da9e1af19c8
BLAKE2b-256 checksum
How to use checksums
6ce6fc96bd2bc911999e1f57fa88715703983b5d7f701006e318bde4de7b1cee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.14

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page