|
@@ -12,7 +12,7 @@ fi
|
|
|
file=$1
|
|
|
sep=$2
|
|
|
|
|
|
-FFMPEG="docker run -ti --rm -v $(pwd):/data -w /data linuxserver/ffmpeg"
|
|
|
+FFMPEG="docker run -ti --rm -v $(pwd):/data -w /data linuxserver/ffmpeg -hide_banner -loglevel error"
|
|
|
FFPROBE="docker run -ti --rm -v $(pwd):/data -w /data --entrypoint ffprobe linuxserver/ffmpeg"
|
|
|
|
|
|
CLIP_LEN=60
|
|
@@ -21,24 +21,31 @@ audio_len=$($FFPROBE -v error -show_entries format=duration -of default=noprint_
|
|
|
max_start=$(expr $audio_len - $CLIP_LEN)
|
|
|
|
|
|
# first make a bunch of 60s clips with random start positions
|
|
|
+echo "Making the clips"
|
|
|
for i in {0..59}; do
|
|
|
+ echo -n "$i "
|
|
|
rand_start=$(($RANDOM % $max_start))
|
|
|
outfile="clip-$i.wav"
|
|
|
$FFMPEG -ss $rand_start -t 60 -i $file $outfile
|
|
|
done
|
|
|
+echo
|
|
|
|
|
|
# next loop over those clips and shrink them appropriately
|
|
|
+echo "Adjusting tempo"
|
|
|
for i in {1..59}; do
|
|
|
+ echo -n "$i "
|
|
|
outfile="clip-$i.wav"
|
|
|
infile="_$outfile.tmp"
|
|
|
mv $outfile $infile
|
|
|
- tempo=$(echo "0.033 * 60"| bc)
|
|
|
+ tempo=$(echo "0.033 * $i"| bc)
|
|
|
$FFMPEG -i $infile -filter:a "atempo=$tempo" -vn $outfile
|
|
|
rm $infile
|
|
|
done
|
|
|
+echo
|
|
|
|
|
|
# stitch em together
|
|
|
# Using a file here because i need to access it in docker
|
|
|
+echo "Stitching them together"
|
|
|
>_concat
|
|
|
for i in {0..59}; do
|
|
|
echo "file clip-$i.wav" >>_concat
|