Chris@0: #!/bin/bash Chris@0: Chris@119: . ../include.sh Chris@0: Chris@119: inbase=$audiopath/3clicks Chris@0: tmpfile1=$mypath/tmp_1_$$ Chris@0: tmpfile2=$mypath/tmp_2_$$ Chris@0: Chris@0: trap "rm -f $tmpfile1 $tmpfile2" 0 Chris@0: Chris@0: for extension in wav ogg mp3 ; do Chris@0: Chris@119: transform=$mypath/transforms/percussiononsets.n3 Chris@119: expected=$mypath/expected/percussiononsets-$extension.csv Chris@0: Chris@0: test -f $transform || \ Chris@119: fail "Internal error: no transforms file" Chris@0: Chris@0: test -f $expected || \ Chris@119: fail "Internal error: no expected output file for extension $extension" Chris@0: Chris@0: infile=$inbase.$extension Chris@0: if [ "$extension" = "wav" ]; then infile=${inbase}8.$extension; fi Chris@0: Chris@0: test -f $infile || \ Chris@0: fail "Internal error: no input audio file for extension $extension" Chris@0: Chris@0: $r -t $transform -w csv --csv-stdout $infile > $tmpfile2 2>/dev/null || \ Chris@0: fail "Fails to run transform $transform against audio file $infile" Chris@0: Chris@0: if [ "$extension" = "wav" ]; then Chris@28: csvcompare $tmpfile2 $expected || \ Chris@118: faildiff "Output mismatch for transform $transform with audio file $infile" $tmpfile2 $expected Chris@0: else Chris@28: csvcompare $tmpfile2 $expected || \ Chris@0: ( echo "NOTE: Output mismatch for transform $transform with audio file $infile" ; \ Chris@0: echo "This may be the result of differences in the audio file decoder, so I am not" ; \ Chris@0: echo "failing the test, but I recommend that you check the results." ) Chris@0: fi Chris@0: done Chris@0: Chris@126: # Check the normalise flag Chris@126: Chris@126: $r -d $amplplug -w csv --csv-stdout ${inbase}8quiet.wav 2>/dev/null | head > $tmpfile1 || \ Chris@126: fail "Fails to run default transform for plugin $amplplug against audio file ${inbase}8quiet.wav" Chris@126: csvcompare $tmpfile1 $mypath/expected/norm-off.csv || \ Chris@126: faildiff "Output mismatch for default transform for plugin $amplplug against audio file ${inbase}8quiet.wav without normalisation" $tmpfile1 $mypath/expected/norm-off.csv Chris@126: Chris@126: $r -d $amplplug -n -w csv --csv-stdout ${inbase}8quiet.wav 2>/dev/null | head > $tmpfile1 || \ Chris@126: fail "Fails to run default transform for plugin $amplplug against audio file ${inbase}8quiet.wav with normalisation" Chris@126: csvcompare $tmpfile1 $mypath/expected/norm-on.csv || \ Chris@126: faildiff "Output mismatch for default transform for plugin $amplplug against audio file ${inbase}8quiet.wav with normalisation" $tmpfile1 $mypath/expected/norm-on.csv Chris@126: Chris@126: $r -d $amplplug --normalise -w csv --csv-stdout ${inbase}8quiet.wav 2>/dev/null | head > $tmpfile1 || \ Chris@126: fail "Fails to run default transform for plugin $amplplug against audio file ${inbase}8quiet.wav with normalisation" Chris@126: csvcompare $tmpfile1 $mypath/expected/norm-on.csv || \ Chris@126: faildiff "Output mismatch for default transform for plugin $amplplug against audio file ${inbase}8quiet.wav with normalisation" $tmpfile1 $mypath/expected/norm-on.csv Chris@126: Chris@0: exit 0