Skip to content
Extraits de code Groupes Projets
Valider 698ac7e7 rédigé par Sting's avatar Sting
Parcourir les fichiers

Update README + plot_syls

parent 4ddf1bed
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!4Lyrics Alignment
...@@ -73,17 +73,21 @@ Having a CUDA-capable GPU is optional, but can greatly reduce processing time in ...@@ -73,17 +73,21 @@ Having a CUDA-capable GPU is optional, but can greatly reduce processing time in
## Autokara ## Autokara
To execute AutoKara from scratch on a MKV video file : To use Autokara, you need :
- A media file of the song (video, or pre-extracted vocals)
- An ASS file with the lyrics, split by syllable
To execute AutoKara on a MKV video file and an ASS file containing the lyrics (ASS will be overwritten):
```bash ```bash
$ python autokara.py video.mkv output.ass $ python autokara.py video.mkv lyrics.ass
``` ```
To execute AutoKara with existing syl splits and line timings : To output to a different file (and keep the original) :
```bash ```bash
$ python autokara.py video.mkv output.ass --ref reference.ass $ python autokara.py video.mkv lyrics.ass -o output.ass
``` ```
To execute AutoKara on a (pre-extracted) WAV vocals file : To execute AutoKara on a (pre-extracted) WAV (or OGG, MP3, ...) vocals file, pass the `--vocals` flag :
```bash ```bash
$ python autokara.py vocals.wav output.ass --vocals $ python autokara.py vocals.wav output.ass --vocals
``` ```
...@@ -110,6 +114,12 @@ Batch preprocessing (vocals + ASS extraction) of all videos in a directory : ...@@ -110,6 +114,12 @@ Batch preprocessing (vocals + ASS extraction) of all videos in a directory :
$ ./preprocess_media.sh video_folder output_folder $ ./preprocess_media.sh video_folder output_folder
``` ```
A visualization tool, mainly intended for debug.
Does the same as autokara.py, but instead of writing to a file, plots a graphic with onset times, spectrogram, probability curves,...
Does not work on video files, only separated vocals audio files
```bash
$ python plot_syls.py vocals.wav lyrics.ass
```
...@@ -5,6 +5,7 @@ import re ...@@ -5,6 +5,7 @@ import re
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import scipy.signal as sg import scipy.signal as sg
import parselmouth import parselmouth
import argparse
from autosyl.assUtils import getSyls, timeToDate, dateToTime from autosyl.assUtils import getSyls, timeToDate, dateToTime
from autosyl.LyricsAlignment.wrapper import align, preprocess_from_file from autosyl.LyricsAlignment.wrapper import align, preprocess_from_file
...@@ -19,11 +20,17 @@ from autosyl.LyricsAlignment.wrapper import align, preprocess_from_file ...@@ -19,11 +20,17 @@ from autosyl.LyricsAlignment.wrapper import align, preprocess_from_file
# #
############################################################################## ##############################################################################
songfile = sys.argv[1]
if(len(sys.argv) >= 3): parser = argparse.ArgumentParser(description='AutoKara - Automatic karaoke timing tool')
reference_syls = getSyls(sys.argv[2]) parser.add_argument("vocals_file", type=str, help="The audio file to time")
else: parser.add_argument("ass_file", type=str, help="The ASS file with lyrics to time")
reference_syls = None
args = parser.parse_args()
songfile = args.vocals_file
reference_syls, line_meta = getSyls(sys.argv[2])
print(reference_syls) print(reference_syls)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter