48 lines · 1.3 KB · Text
RawDownload
#!/bin/sh # Sample rate conversion tests.  Create a 20s sweep at the input sampling rate,# then use each resampler to convert it to the output rate.  Display the results# in a PNG file for each conversion. # Set up the following two before running the script:SOX=./sox                        # The actual sox executableSSRC_PATH=/usr/local/bin         # Path to the two ssrc executables RANGE=180 # Temporary filesBASE=`basename $0`IN=/tmp/$BASE-in-$$.wavOUT=/tmp/$BASE-out-$$.wavTIME=/tmp/$BASE-time-$$.wav test_converters () {  # Create input file  max=`expr $1 / 2`  $SOX -r $1 -n -twavpcm $IN synth 20 sin 0:$max sin $max:0 gain -2   for src in \      "rate -h" \      "rate -v" \      "ssrc" \      "ssrc_hp" \      ; do    echo $src    case "$src" in      ssrc*) time -f %U -o $TIME $SSRC_PATH/$src --quiet --rate $2 $IN $OUT;;      *)     time -f %U -o $TIME $SOX $IN -r $2 $OUT $src;;    esac    t=`cat $TIME`    $SOX $OUT -n spectrogram \      -X 30 -z $RANGE -w kaiser \      -t "$1->$2: $src" -c "${t}s user time" \      -o "$1_$2_`echo $src | tr ' ' '_'`.png"  done    rm -f $IN $OUT $TIME # Clean up} test_converters 11025 48000test_converters 22000 96100test_converters 44100 96000test_converters 96000 44100test_converters 96000 8000 # rabbit 0.1.3 hangs, 0.1.4 is okay

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t