From b903670f2159a8ee23b0fa2410c9c2237b74731e Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sat, 20 Dec 2014 14:24:41 +1100 Subject: replaygain test: Use C code to generate test files. --- test/test_replaygain.sh | 58 ++++++------------------------------------------- 1 file changed, 7 insertions(+), 51 deletions(-) (limited to 'test') diff --git a/test/test_replaygain.sh b/test/test_replaygain.sh index 4496fa64..fef74940 100755 --- a/test/test_replaygain.sh +++ b/test/test_replaygain.sh @@ -81,66 +81,22 @@ fi check_flac - -if mawk ; then - AWK=mawk -else - # Really hope awk is not gawk, because the following AWK script doesn't - # work correctly with gawk 4.0.1 but did with earlier versions. - AWK=awk - fi - # Replay gain tests - Test the rates which have specific filter table entries # and verify that harmonics can be processed correctly. tonegenerator () { - # When using GAWK, use --lint=posix to identify non-POSIX awk usages. - $AWK -- ' - BEGIN { - samplerate = '$1'; - - tone = 1000; - duration = 1; - bitspersample = 24; - - samplemidpoint = 1; - for (sps = 0 ; sps < bitspersample - 1 ; sps++) { - samplemidpoint *= 2; - } - - samplerange = samplemidpoint - 1; - - pi = 4 * atan2(1,1); - - for (ix = 0; ix < duration * samplerate; ++ix) { - sample = sin(2 * pi * tone * ix / samplerate); - sample *= samplerange; - sample += samplemidpoint; - sample = int(sample); - for (bx = 0; bx < bitspersample/8; ++bx) { - byte[bx] = sample % 256; - sample /= 256; - } - while (bx--) { - printf("%c", byte[bx]); - } - } - - }' /dev/null | - flac${EXE} --force --output-name=$2 \ - --silent --no-seektable --no-error-on-compression-fail --force-raw-format \ - --endian=big --channels=1 --bps=24 --sample-rate=$1 --sign=unsigned - + flac${EXE} --force --output-name=$2 --silent --no-seektable --no-error-on-compression-fail rpg-tone-$1.wav } REPLAYGAIN_FREQ= -REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 8000/-12.76" -REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 11025/-12.93" -REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 12000/-13.00" -REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 16000/-13.29" -REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 18900/-13.43" +REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 8000/-12.73" +REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 11025/-12.91" +REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 12000/-12.98" +REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 16000/-13.27" +REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 18900/-13.41" REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 22050/-13.77" -REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 24000/-13.83" +REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 24000/-13.82" REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 28000/-14.06" REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 32000/-14.08" REPLAYGAIN_FREQ="$REPLAYGAIN_FREQ 36000/-14.12" -- cgit v1.2.1