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

io-test « tests - github.com/alexmarsev/soxr.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a291c782c441e95693aba454b1ac4ba6befd117b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/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 IO



ir=65537
or=44100
len=16
f=1/32768
g=32768:0
tool=./3-options-input-fn

types=(f32 f64 s32 s16)

zs=(180 180 180 180 180 120 120 120 120)

do_one() {
  $tool $ir $or $c $1 $2 $3 < $c.${types[$1]} |
  sox -t ${types[`expr $2 % 4`]} -r $or -c $c - -n spectrogram -X50 -hwk -z${zs[$n]} -o io$c$n.png -c "io-test i:${types[$1]} o:${types[`expr $2 % 4`]} ($2) q:$3"
  n=`expr $n + 1`
}

j=3; test z$1 != z && j=$1

for c in `seq 1 $j`; do
  for n in `seq 0 3`; do
    sox -r $ir -n $c.${types[$n]} synth $len sin $f gain -.1
  done

  n=0
  do_one 1 2 5
  do_one 2 0 5
  for m in `seq 0 3`; do do_one $m $m 5; done
  do_one 3 2 3
  do_one 0 3 3
  do_one 0 11 3

  f="$f sin $g"
  g=0+32768
done

rm ?.[sf][0-9][0-9]



# Check conversion between differing I/O types, but no rate-change:

for i in 1 2 3; do
  prev=""
  sox -n -c $i 0.f32 synth $len gain -.1
  $tool 1 1 $i 0 2 < 0.f32 | $tool 1 1 $i 2 0 > 1.f32
  cmp [01].f32
done
rm *.f32