File size: 638 Bytes
a03c9b4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#!/bin/bash
shopt -s globstar
for file in "$1"/**/*.wav; do
echo $file
output_dir="tmp"
spleeter separate -b 256k -B tensorflow -p spleeter:2stems -o $output_dir $file -f {instrument}.{codec}
sox --ignore-length tmp/accompaniment.wav -r 16000 -c 1 -b 16 tmp/accompaniment_16k.wav
sox --ignore-length tmp/vocals.wav -r 16000 -c 1 -b 16 tmp/vocals_16k.wav
acc_file="${file//.wav/_accompaniment.wav}"
voc_file="${file//.wav/_vocals.wav}"
mv -f "tmp/accompaniment_16k.wav" $acc_file
mv -f "tmp/vocals_16k.wav" $voc_file
echo $acc_file
echo $voc_file
rm -rf tmp
done
rm -rf pretrained_models |