2021-2 YBIGTA Conference
#Preprocess Dataset
- Install ffmpeg with apt and pip install youtube-dl
- Set Playlist and get the URL of the youtube playlist
- Get wav file below youtube-dl commands
youtube-dl --extract-audio --audio-format wav -i PLCVawrYUsJRvAIs5IxhbbksZtXFE0snnh
--audio-format : Automatically executre ffmpeg
-i : Identify playlist ID which placed after URL playlist=PLCVawrYUsJRvAIs5IxhbbksZtXFE0snnh
- Use spleeter to seperate vocals and MR files (Can Skip)
You can find Separator class with spleeter.separator
from spleeter.separator import Separator
# Using embedded configuration.
separator = Separator('spleeter:2stems')
# Using custom configuration file.
separator = Separator('/path/to/config.json')
You can find AudioAdapter to sperate files spleeter.audio.adapter
# Use audio loader explicitly for loading audio waveform :
from spleeter.audio.adapter import AudioAdapter
audio_loader = AudioAdapter.default()
sample_rate = 44100
waveform, _ = audio_loader.load('/path/to/audio/file', sample_rate=sample_rate)
# Perform the separation :
prediction = separator.separate(waveform)
https://github.com/deezer/spleeter/wiki/4.-API-Reference#separator
For convenience already prepared at data_preprocessing.py
- Change PATH if you need to change data_preprocessing.py
if __name__ == '__main__':
# Configuration of dataset path
# CHANGE IF YOU NEED
base_path = '/home/ryan0507/VoiceConversion/data/'
dataset_dir = '/home/ryan0507/VoiceConversion/data'
- After Run data_preprocessing.py you can get vocal and MR files for the playlist