]> de.git.xonotic.org Git - xonotic/mediasource.git/blob - sound/weapons/loopfinder/findloop.sh
ebbdb20c450bd573f0c4fb1c0574f8c36d578a47
[xonotic/mediasource.git] / sound / weapons / loopfinder / findloop.sh
1 #!/bin/sh
2
3 infile=$1
4 outfile=$2
5 end=$3
6 guess=$4
7 fftsize=${5:-32768}
8
9 gcc -o findloop findloop.c -lfftw3 -Wall -Wextra -ffast-math -lsndfile -O3
10 ./findloop "$infile" "$fftsize" "$end" "$guess" temp.wav | while read -r SAMPLES SECONDS; do
11         oggenc -q 3 -o "$outfile" -c LOOP_START=$SAMPLES temp.wav
12         rm -f temp.wav
13         echo "To repeat, seek to $SAMPLES"
14         vorbisgain "$outfile"
15 done