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