5
# Script to generate and test audio selecting.
6
# The output files need to be verified manually.
8
# ----------------------------------------------------------------------
9
# File: ecasound/manual-tests/test-klg.sh
10
# License: GPL (see ecasound/{AUTHORS,COPYING})
11
# ----------------------------------------------------------------------
13
if test "x${ECASOUND}" = "x" ; then
14
ECASOUND=../../ecasound/ecasound_debug
21
# specify ecasound binary used to generate test reference files
22
ECAS_REF=ecasound-2.6.0
23
CMP=../utils/ecacompare
27
# generate source file
28
$ECASOUND -q -f:16,1,44100 -i tone,sine,880,0 -o src44100.wav -t:10 || error_exit
29
ln -s src44100.wav src44100.foobar
33
$ECAS_REF -q -f:16,1,44100 -i select,1,22000sa,src44100.wav -o as-dst22000sa-ref.wav -x || error_exit
34
$ECASOUND -q -f:16,1,44100 -i select,1,22000sa,src44100.wav -o as-dst22000sa.wav -x || error_exit
36
samples=`sndfile-info as-dst22000sa.wav |grep Frames |cut -d ':' -f2`
37
if [ $samples != "22000" ] ; then error_exit ; fi
38
$CMP as-dst22000sa.wav as-dst22000sa-ref.wav
39
if [ $? != 0 ] ; then error_exit ; fi
41
# perform test 2 (lq -> ext resamplers are not necessarily supported)
43
$ECAS_REF -q -f:16,1,88200 -i select,1.9,33000sa,resample-lq,44100,src44100.wav -o as-dst33000sa-ref.wav -x || error_exit
44
$ECASOUND -q -f:16,1,88200 -i select,1.9,33000sa,resample-lq,44100,src44100.wav -o as-dst33000sa.wav -x || error_exit
46
samples=`sndfile-info as-dst33000sa.wav |grep Frames |cut -d ':' -f2`
47
if [ $samples != "33000" ] ; then error_exit ; fi
48
$CMP as-dst33000sa.wav as-dst33000sa-ref.wav
49
if [ $? != 0 ] ; then error_exit ; fi
53
$ECAS_REF -q -f:16,1,44100 -i select,40000sa,55000sa,typeselect,.wav,src44100.foobar -o as-dst55000sa-ref.wav -x || error_exit
54
$ECASOUND -q -f:16,1,44100 -i select,40000sa,55000sa,typeselect,.wav,src44100.foobar -o as-dst55000sa.wav -x || error_exit
56
samples=`sndfile-info as-dst55000sa.wav |grep Frames |cut -d ':' -f2`
57
if [ $samples != "55000" ] ; then error_exit ; fi
58
$CMP as-dst55000sa.wav as-dst55000sa-ref.wav
59
if [ $? != 0 ] ; then error_exit ; fi
61
echo "Test run succesful (no manual verification needed)."
62
echo "Run './clean.sh' to remove created audio files."