boo/soxr/tests/large-ratio-test

23 lines
743 B
Plaintext
Raw Permalink Normal View History

#!/usr/bin/env bash
2016-03-23 05:33:14 +00:00
set -e
# SoX Resampler Library Copyright (c) 2007-16 robs@users.sourceforge.net
2016-03-23 05:33:14 +00:00
# Licence for this file: LGPL v2.1 See LICENCE for details.
# Tests interpolating then decimating by the same, large ratio.
2016-03-23 05:33:14 +00:00
tool=../examples/3-options-input-fn
w=$(echo -e "`sox --ver |sed 's/.*SoX v//'` d\n14.4.1 k"|sort -Vr|head -1|sed 's/.* //')
q=4
test x$1 = x && ratio=1e5 || ratio=$1
test x$2 = x && rate=8000 || rate=$2
2016-03-23 05:33:14 +00:00
sox -r$rate -n 1.s32 synth 10 sin 0:`expr $rate / 2` vol .9375
sync
2016-03-23 05:33:14 +00:00
time { $tool 1 $ratio 1 2 1 $q a < 1.s32 | $tool $ratio 1 1 1 2 $q a > 2.s32;}
2016-03-23 05:33:14 +00:00
sox -mv-1 -r$rate -c1 1.s32 -r$rate -c1 2.s32 -n spectrogram -hw$w -z150 -o lr-$w.png -c "large-ratio-test q:$q ratio:$ratio"
2016-03-23 05:33:14 +00:00
rm [12].s32