Skip to content

Instantly share code, notes, and snippets.

@donnaken15
Created January 15, 2023 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donnaken15/9a6c38b9205d8a6c65afde6fa4ad6f27 to your computer and use it in GitHub Desktop.
Save donnaken15/9a6c38b9205d8a6c65afde6fa4ad6f27 to your computer and use it in GitHub Desktop.
FastGH3 encoding speed test / requires shell (from Cygwin or MinGW), run in DATA/MUSIC/TOOLS
if [ ! "$(dirname "$0")" = "." ]; then
here=$(realpath "$0")/
else
here=$(which "$0")/
fi
here=$(dirname "$here")
TIMEFORMAT=%R
LPARAMS="--cbr -b 128 --resample 44100 -m j"
TARGET="$1"
EXT=$(basename "$TARGET")
EXT=${EXT##*.}
LAME_AVG=""
SOX_AVG=""
PIPE_AVG=""
XING_AVG=""
RANGE=$(echo {1..20})
SAMPLES=20
#./lame.exe $LPARAMS "${TARGET}" test.mp3
#./sox.exe "${TARGET}" -c 2 -r 44100 -S --multi-threaded -t mp3 -C 128 - | "%~dp0lame" %LPARAMS% - %2
echo "$here/lame.exe"
echo LAME $EXT TO MP3
for i in $RANGE; do
echo lame try$i
t0=$({ time "${here}/lame.exe" $LPARAMS "${TARGET}" test.mp3 2>/dev/null 1>/dev/null; } 2>&1)
LAME_AVG="${LAME_AVG} ${t0}"
echo $t0
done
sum=0
for i in $LAME_AVG; do
sum=$(evl $sum+$i)
done
avg=$(evl $sum/$SAMPLES)
echo avg:
echo $avg
echo SOX $EXT TO MP3
for i in $RANGE; do
echo sox try$i
t0=$({ time "${here}/sox.exe" "${TARGET}" -c 2 -r 44100 -S --multi-threaded -t mp3 -C 128 test.mp3 2>/dev/null 1>/dev/null; } 2>&1)
SOX_AVG="${SOX_AVG} ${t0}"
echo $t0
done
sum=0
for i in $SOX_AVG; do
sum=$(evl $sum+$i)
done
avg=$(evl $sum/$SAMPLES)
echo avg:
echo $avg
echo SOX $EXT TO LAME MP3
for i in $RANGE; do
echo pipe try$i
t0=$({ time "${here}/pipetest.sh" "${TARGET}" 2>/dev/null 1>/dev/null; } 2>&1)
PIPE_AVG="${PIPE_AVG} ${t0}"
echo $t0
done
sum=0
for i in $PIPE_AVG; do
sum=$(evl $sum+$i)
done
avg=$(evl $sum/$SAMPLES)
echo avg:
echo $avg
echo SOX $EXT TO HELIX MP3
for i in $RANGE; do
echo pipe try$i
t0=$({ time "${here}/pipetest2.sh" "${TARGET}" 2>/dev/null 1>/dev/null; } 2>&1)
XING_AVG="${XING_AVG} ${t0}"
echo $t0
done
sum=0
for i in $XING_AVG; do
sum=$(evl $sum+$i)
done
avg=$(evl $sum/$SAMPLES)
echo avg:
echo $avg
LPARAMS="--cbr -b 128 --resample 44100 -m j"
TARGET=$1
./sox.exe "${TARGET}" -c 2 -r 44100 -S --multi-threaded -t wav - | ./lame.exe $LPARAMS - test.mp3
TARGET=$1
./sox.exe "${TARGET}" -c 2 -r 44100 -S --multi-threaded -t wav - | ./helix.exe - test.mp3 -B64 -M1 -u2 -q1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment