Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/alexmarsev/soxr.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Sykes <robs@users.sourceforge.net>2015-08-20 22:31:13 +0300
committerRob Sykes <robs@users.sourceforge.net>2015-08-20 22:31:13 +0300
commit86e855d3e4d676df597e168ccbc93c232827eece (patch)
tree7d74f5325e0252cd352ca89a17a481828b4c3fd5
parent0d609771798069216302cb44ddab8f7f32f68a8d (diff)
improve test-scripts
-rwxr-xr-xtests/bandwidth-test39
-rwxr-xr-xtests/eg-test5
-rwxr-xr-xtests/io-test4
-rwxr-xr-xtests/phase-test5
-rwxr-xr-xtests/q-test18
5 files changed, 53 insertions, 18 deletions
diff --git a/tests/bandwidth-test b/tests/bandwidth-test
new file mode 100755
index 0000000..0e862de
--- /dev/null
+++ b/tests/bandwidth-test
@@ -0,0 +1,39 @@
+#!/bin/bash
+set -e
+
+# SoX Resampler Library Copyright (c) 2007-15 robs@users.sourceforge.net
+# Licence for this file: LGPL v2.1 See LICENCE for details.
+
+# Tests varying bandwidth.
+
+
+
+tool=./3-options-input-fn
+
+spec="spectrogram -z120 -Z-20 -wd -ho"
+ext=f32; e=0
+rate1=48000
+rate2=44100
+
+for n in 1 2; do
+
+rate1n=`expr $rate1 / 2`
+
+#sox -r $rate1 -n 0.$ext synth 1s sq pad .03 .03 gain -1
+sox -r $rate1 -n 0.$ext synth 8 sin 0:$rate1n gain -1
+
+for q in `seq 79 5 99`; do
+ f=bw1-$rate2-p`printf %02u $q`
+ $tool $rate1 $rate2 1 $e $e 4 0 $q < 0.$ext | sox -c1 -r$rate2 -t $ext - -n $spec $f.png
+done
+
+for q in `seq 79 5 99`; do
+ f=bw2-$rate2-p`printf %02u $q`
+ $tool $rate1 $rate2 1 $e $e 4 0 $q `expr 200 - $q` < 0.$ext | sox -c1 -r$rate2 -t $ext - -n $spec $f.png
+done
+
+r=$rate1; rate1=$rate2; rate2=$r
+
+done
+
+rm 0.$ext
diff --git a/tests/eg-test b/tests/eg-test
index 117e3dc..7364065 100755
--- a/tests/eg-test
+++ b/tests/eg-test
@@ -1,10 +1,10 @@
#!/bin/bash
set -e
-# SoX Resampler Library Copyright (c) 2007-14 robs@users.sourceforge.net
+# SoX Resampler Library Copyright (c) 2007-15 robs@users.sourceforge.net
# Licence for this file: LGPL v2.1 See LICENCE for details.
-# Exercise each example programme:
+# Exercises each example programme.
@@ -37,7 +37,6 @@ rm *.f32
# Exercise VR making sure that varied internal stage reconfigurations occur:
-rm -f v?.png
for n in 0 1 2 3; do
$vg ./5-variable-rate $n | sox -tf32 -r44100 -c1 - -n spectrogram -z130 -hwd -o v$n.png -X 50
vg=""
diff --git a/tests/io-test b/tests/io-test
index 36b244f..11530a3 100755
--- a/tests/io-test
+++ b/tests/io-test
@@ -1,7 +1,7 @@
#!/bin/bash
set -e
-# SoX Resampler Library Copyright (c) 2007-13 robs@users.sourceforge.net
+# SoX Resampler Library Copyright (c) 2007-15 robs@users.sourceforge.net
# Licence for this file: LGPL v2.1 See LICENCE for details.
# Tests IO
@@ -23,8 +23,6 @@ do_one() {
n=`expr $n + 1`
}
-rm -f io??.png
-
j=3; test z$1 != z && j=$1
for c in `seq 1 $j`; do
diff --git a/tests/phase-test b/tests/phase-test
index 622e6aa..a3d87bb 100755
--- a/tests/phase-test
+++ b/tests/phase-test
@@ -1,17 +1,16 @@
#!/bin/bash
set -e
-# SoX Resampler Library Copyright (c) 2007-14 robs@users.sourceforge.net
+# SoX Resampler Library Copyright (c) 2007-15 robs@users.sourceforge.net
# Licence for this file: LGPL v2.1 See LICENCE for details.
# Tests varying phase-response.
-rm -f ph-*.png
tool=./3-options-input-fn
-spec="spectrogram -z180 -Z-20 -wd -ho"
+spec="spectrogram -z160 -Z-20 -wd -ho"
ext=f32; e=0
rate1=48000
rate2=44100
diff --git a/tests/q-test b/tests/q-test
index aa9a00b..89cf64f 100755
--- a/tests/q-test
+++ b/tests/q-test
@@ -1,14 +1,14 @@
#!/bin/bash
set -e
-# SoX Resampler Library Copyright (c) 2007-14 robs@users.sourceforge.net
+# SoX Resampler Library Copyright (c) 2007-15 robs@users.sourceforge.net
# Licence for this file: LGPL v2.1 See LICENCE for details.
-# Tests rate conversion time and generates spectrograms for qualities 0..7 & variable-rate.
+# Tests rate conversion time and generates spectrograms for
+# qualities 0..7 & variable-rate.
-rm -f *.png *.wav
tool=./3-options-input-fn
spec="spectrogram -z180 -Z-20 -wd -ho"
@@ -52,10 +52,10 @@ time $tool $rate1 $rate2 $c $e $e 4 20 < 0.$ext > /dev/null
sox -r $rate1 -n -c $c 0.$ext synth 8 sin 0:$rate1n gain -1
for q in `seq $q1 $q2`; do
- f=$rate1-$rate2-a-$q
+ f=q$rate1-$rate2-a-$q
$tool $rate1 $rate2 $c $e $e $q 0 < 0.$ext | sox -c$c -r$rate2 -t $ext - -n $spec $f.png
done
-f=$rate1-$rate2-a-v
+f=q$rate1-$rate2-a-v
$tool $rate1 $rate2 $c $e $e 4 20 < 0.$ext | sox -c$c -r$rate2 -t $ext - -n $spec $f.png
@@ -66,16 +66,16 @@ $tool $rate1 $rate2 $c $e $e 4 20 < 0.$ext | sox -c$c -r$rate2 -t $ext - -n $spe
sox -r $rate1 -n 0.$ext synth 1s sq pad .03 .03 gain -1
for q in `seq $q1 $q2`; do
- f=$rate1-$rate2-b-$q
+ f=q$rate1-$rate2-b-$q
$tool $rate1 $rate2 1 $e $e $q 0 < 0.$ext | sox -c1 -r$rate2 -t $ext - $f.wav $spec $f.png -X 2000
done
-f=$rate1-$rate2-b-v
+f=q$rate1-$rate2-b-v
$tool $rate1 $rate2 1 $e $e 4 20 < 0.$ext | sox -c1 -r$rate2 -t $ext - $f.wav $spec $f.png -X 2000
# Combine impuse responses into multi-channel file (for inspection in Audacity):
-sox -M $rate1-$rate2-b-?.wav $rate1-$rate2.wav
+sox -M q$rate1-$rate2-b-?.wav q$rate1-$rate2.wav
-rm $rate1-$rate2-b-?.wav
+rm q$rate1-$rate2-b-?.wav
:
rate1=44100