# HG changeset patch # User Chris Cannam # Date 1382343862 -3600 # Node ID 24598a8754b475d80ce42313e4ec020f7ba02106 # Parent 83e285b97c01b4442590ea2dce1eccb40467a4db Some helpful output diff -r 83e285b97c01 -r 24598a8754b4 run-tests.sh --- a/run-tests.sh Fri Oct 18 17:44:09 2013 +0100 +++ b/run-tests.sh Mon Oct 21 09:24:22 2013 +0100 @@ -9,6 +9,24 @@ original=96000 +resample="$mydir/garage-resampler/resample" +decimate="$mydir/qm-dsp-decimate/decimate" + +if [ ! -x "$resample" ]; then + echo "Program $resample not found: Try running make?" + exit 1 +fi + +if [ ! -x "$decimate" ]; then + echo "Program $decimate not found: Try running make?" + exit 1 +fi + +if ! sndfile-resample 2>&1 | grep -q samplerate ; then + echo "Program sndfile-resample not found in PATH?" + exit 1 +fi + do_src() { factor="$1" infile="$2" @@ -29,21 +47,21 @@ factor="$1" infile="$2" outfile="$3" - time "$mydir/garage-resampler/resample" --snr 100 --bandwidth 0.02 --to "$(($original/$factor))" "$infile" "$outfile" + time "$resample" --snr 100 --bandwidth 0.02 --to "$(($original/$factor))" "$infile" "$outfile" } do_resample_mq() { factor="$1" infile="$2" outfile="$3" - time "$mydir/garage-resampler/resample" --snr 70 --bandwidth 0.03 --to "$(($original/$factor))" "$infile" "$outfile" + time "$resample" --snr 70 --bandwidth 0.03 --to "$(($original/$factor))" "$infile" "$outfile" } do_resample_lq() { factor="$1" infile="$2" outfile="$3" - time "$mydir/garage-resampler/resample" --snr 50 --bandwidth 0.05 --to "$(($original/$factor))" "$infile" "$outfile" + time "$resample" --snr 50 --bandwidth 0.05 --to "$(($original/$factor))" "$infile" "$outfile" } decimate_twice() { @@ -51,8 +69,8 @@ second="$2" infile="$3" outfile="$4" - "$mydir/qm-dsp-decimate/decimate" --by "$first" "$infile" "$outfile".tmp - "$mydir/qm-dsp-decimate/decimate" --by "$second" "$outfile".tmp "$outfile" + "$decimate" --by "$first" "$infile" "$outfile".tmp + "$decimate" --by "$second" "$outfile".tmp "$outfile" rm "$outfile".tmp } @@ -64,7 +82,7 @@ 16) decimate_twice 4 4 "$infile" "$outfile";; 32) decimate_twice 8 4 "$infile" "$outfile";; 64) decimate_twice 8 8 "$infile" "$outfile";; - *) "$mydir/qm-dsp-decimate/decimate" --by "$factor" "$infile" "$outfile";; + *) "$decimate" --by "$factor" "$infile" "$outfile";; esac }