Multichannel segmented audio player demo There is only very few albums uploaded, due to copyright laws. Sorry for not providing further, or not providing a library functionality, copyright laws for music are very strict.
Here is how uploading process works:
- Split track with Audio Seperator
from audio_separator.separator import Separator
separator = Separator(output_format="mp3")
separator.load_model("mel_band_roformer_karaoke_aufr33_viperx_sdr_10.1956.ckpt")
separator.separate("2023 - Rat Wars/09. ASHAMED.mp3")
Out of all models, mel_band_roformer_karaoke_aufr33_viperx_sdr_10.1956
was cleanest and fastest.
- Run utilities.
- Waveform Peaks BBC - audiowaveform for vocal and instrumental
audiowaveform -i 09.ASHAMED_vocal.mp3 --pixels-per-second 100 --output-format json > 09.ASHAMED_vocal.json
- Duration FFMPEG.
ffprobe -i 09.ASHAMED_vocal.mp3 -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 -v error
- Tempo sonic-annotator.
sonic-annotator -d vamp:qm-vamp-plugins:qm-tempotracker:tempo-w csv 09.ASHAMED_vocal.mp3
- Key keyfinder-cli
keyfinder-cli 09.ASHAMED_vocal.mp3
- Metatadata exif-tool
exiftool 09.ASHAMED_vocal.mp3
- Segment both vocal and instrumental audio with FFMPEG.
ffmpeg -i file_path -c:a aac -b:a 320k -f segment -segment_time 40 -segment_list ashamed_playlist.m3u8 -segment_format mpegts ashamed_segment_%03d.ts
- Upload segments, playlists and cover to S3,
- Vocal path =>
cansu-dev-dj/Burnt Sugar/01. Only Friend/vocal/
- Instrumental path =>
cansu-dev-dj/Burnt Sugar/01. Only Friend/instrumental/
- Cover path =>
cansu-dev-dj/Burnt Sugar/cover.jpg
(it must becover.png
, will make it flexible later on)
- Vocal path =>
- Upload metadata and every other utility outputs to backend server in the format of
{
"metadata": '',
"key": '',
"tempo": '', // send the sonic annotator output as it is 124.25876923076923, it will be rounded up/down or trimmed.
"length": 230, // send the ffprobe output as it is like 56.790204
"instrumentalFolderPath": '', // required
"instrumental": false,
"vocalFolderPath": '', // empty if no vocals
"waveform": [],
"vocalWaveform": [],
}
Note that, after upload, cover image will not be optimized, and served from S3 as it is. You can use imagemagick
if your cover files are too large (this example clips any cover art larger than 400x400 to the 400x400 with %85 quality)
convert RAT_WARS_COVER.jpg -strip -quality 85 -resize "400x>" -sampling-factor 4:2:0 -colorspace sRGB -interlace Plane cover.png
I will make a GUI for this process soon.