Skip to content

Instantly share code, notes, and snippets.

@TomScotch
Created December 15, 2019 02:56
Show Gist options
  • Select an option

  • Save TomScotch/e354416d5f2cc56ad7b16ca02375b3a9 to your computer and use it in GitHub Desktop.

Select an option

Save TomScotch/e354416d5f2cc56ad7b16ca02375b3a9 to your computer and use it in GitHub Desktop.
use spleeter to extract music , this script chops down your file before extraction and joins the wav files
f=$(ls -r $1/*/drums.wav) ; shntool join $f ; mv joined.wav $1/drums.wav
f=$(ls -r $1/*/vocals.wav) ; shntool join $f ; mv joined.wav $1/vocals.wav
f=$(ls -r $1/*/bass.wav) ; shntool join $f ; mv joined.wav $1/bass.wav
f=$(ls -r $1/*/other.wav) ; shntool join $f ; mv joined.wav $1/other.wav
for x in $( ls -1 $1/*.mp3 ) ; do spleeter separate -i $x -o $1 -p spleeter:4stems ; done
mkdir $2 ; ffmpeg -i $1 -f segment -segment_time 60 -c copy $2/%03d.mp3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment