Mercurial > hg > sonic-annotator
changeset 126:e6379b2e1c5c
Normalisation test
author | Chris Cannam |
---|---|
date | Thu, 09 Oct 2014 12:27:17 +0100 |
parents | 685e5cf3cb1d |
children | f0df07da6f46 |
files | .hgignore tests/audio/3clicks8quiet.wav tests/include.sh tests/test-audioformat/expected/norm-off.csv tests/test-audioformat/expected/norm-on.csv tests/test-audioformat/test-audioformat.sh tests/test-multiple-audio/expected/all-files.csv |
diffstat | 7 files changed, 42 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Thu Oct 09 10:41:40 2014 +0100 +++ b/.hgignore Thu Oct 09 12:27:17 2014 +0100 @@ -10,7 +10,6 @@ *.so *.so.* *.a -*.wav *~ *.orig *.rej
--- a/tests/include.sh Thu Oct 09 10:41:40 2014 +0100 +++ b/tests/include.sh Thu Oct 09 12:27:17 2014 +0100 @@ -7,6 +7,7 @@ audiopath=$testdir/audio percplug=vamp:vamp-example-plugins:percussiononsets +amplplug=vamp:vamp-example-plugins:amplitudefollower testplug=vamp:vamp-test-plugin:vamp-test-plugin fail() {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-audioformat/expected/norm-off.csv Thu Oct 09 12:27:17 2014 +0100 @@ -0,0 +1,10 @@ +"./../audio/3clicks8quiet.wav",0.000000000,0.00555121 +,0.023219954,0.00547576 +,0.046439909,0.00564068 +,0.069659863,0.00546322 +,0.092879818,0.00562361 +,0.116099773,0.00556463 +,0.139319727,0.00536865 +,0.162539682,0.00531881 +,0.185759637,0.00515389 +,0.208979591,0.00555715
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-audioformat/expected/norm-on.csv Thu Oct 09 12:27:17 2014 +0100 @@ -0,0 +1,10 @@ +"./../audio/3clicks8quiet.wav",0.000000000,0.054658 +,0.023219954,0.0539152 +,0.046439909,0.055539 +,0.069659863,0.0537917 +,0.092879818,0.0553709 +,0.116099773,0.0547902 +,0.139319727,0.0528606 +,0.162539682,0.0523698 +,0.185759637,0.050746 +,0.208979591,0.0547165
--- a/tests/test-audioformat/test-audioformat.sh Thu Oct 09 10:41:40 2014 +0100 +++ b/tests/test-audioformat/test-audioformat.sh Thu Oct 09 12:27:17 2014 +0100 @@ -39,4 +39,21 @@ fi done +# Check the normalise flag + +$r -d $amplplug -w csv --csv-stdout ${inbase}8quiet.wav 2>/dev/null | head > $tmpfile1 || \ + fail "Fails to run default transform for plugin $amplplug against audio file ${inbase}8quiet.wav" +csvcompare $tmpfile1 $mypath/expected/norm-off.csv || \ + faildiff "Output mismatch for default transform for plugin $amplplug against audio file ${inbase}8quiet.wav without normalisation" $tmpfile1 $mypath/expected/norm-off.csv + +$r -d $amplplug -n -w csv --csv-stdout ${inbase}8quiet.wav 2>/dev/null | head > $tmpfile1 || \ + fail "Fails to run default transform for plugin $amplplug against audio file ${inbase}8quiet.wav with normalisation" +csvcompare $tmpfile1 $mypath/expected/norm-on.csv || \ + faildiff "Output mismatch for default transform for plugin $amplplug against audio file ${inbase}8quiet.wav with normalisation" $tmpfile1 $mypath/expected/norm-on.csv + +$r -d $amplplug --normalise -w csv --csv-stdout ${inbase}8quiet.wav 2>/dev/null | head > $tmpfile1 || \ + fail "Fails to run default transform for plugin $amplplug against audio file ${inbase}8quiet.wav with normalisation" +csvcompare $tmpfile1 $mypath/expected/norm-on.csv || \ + faildiff "Output mismatch for default transform for plugin $amplplug against audio file ${inbase}8quiet.wav with normalisation" $tmpfile1 $mypath/expected/norm-on.csv + exit 0
--- a/tests/test-multiple-audio/expected/all-files.csv Thu Oct 09 10:41:40 2014 +0100 +++ b/tests/test-multiple-audio/expected/all-files.csv Thu Oct 09 12:27:17 2014 +0100 @@ -14,6 +14,10 @@ ,0.000000000,5.201269840,median,168,"(median value, continuous-time average)" ,0.000000000,5.201269840,mode,0,"(modal value, continuous-time average)" ,0.000000000,5.201269840,mean,677.241,"(mean value, continuous-time average)" +"./../audio/3clicks8quiet.wav",0.000000000,5.201269840,mean,162.266,"(mean value, continuous-time average)" +,0.000000000,5.201269840,median,169,"(median value, continuous-time average)" +,0.000000000,5.201269840,mode,0,"(modal value, continuous-time average)" +,0.000000000,5.201269840,mean,648.857,"(mean value, continuous-time average)" "./../audio/6clicks.ogg",0.000000000,10.031020407,mean,166.612,"(mean value, continuous-time average)" ,0.000000000,10.031020407,median,167,"(median value, continuous-time average)" ,0.000000000,10.031020407,mode,170,"(modal value, continuous-time average)"