Using ASR to obtain syllables, matching text from lyrics, and generating JSON for Minlabel preloading.
-
Install
pip install -r requirements.txt
-
Collect lyric
-
Collect the original lyrics text and place it in the Lyric folder. The content is pure lyrics, and the file name is consistent with the audio before the AudioSlicer slicing (i.e. the part before the file name '_' after slicing)
lyric ├── chuanqi.txt ├── caocao.txt └── ... -
Place the cut file fragments in the wav folder. Unify the file name with the previous lyrics: [lyricName]_ xxx.wav.
If there are multiple '_' in the file name, Take the far right as the dividing line. The file name in the left half must be the same as the lyrics file name in the previous step.
wav ├── caocao_001.wav ├── caocao_002.wav └── ... -
Run fun_asr.py obtains the lab results of asr.
python fun_asr.py --language zh/en --wav_folder wav_folder --lab_folder lab_folder Option: --language str zh/en --wav_folder str Sliced wav file folder (*.wav). --lab_folder str Folder for outputting lab files. -
Run match_lyric.py obtains JSON and put it in the annotation folder of Minlabel.
python match_lyric.py --lyric_folder lyric --lab_folder lab_folder --json_folder json_folder --language zh/en Option: --lyric_folder str The file name corresponds to the lab prefix (before \'_\'), only pure lyrics are allowed (*.txt). --lab_folder str Chinese characters or pinyin separated by spaces obtained from ASR (*.lab). --json_folder str Folder for outputting JSON files. --diff_threshold int Only display different results with n words or more. --language str zh/en
-