1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-12-23 19:22:04 +02:00
openwrt-packages/nanonote-files/base-files/usr/bin/wav2png

15 lines
301 B
Bash
Executable File

#!/bin/sh
#usage: wav2png.sh file.wav
BASE=${1%.wav}
PNG=$BASE.png
WAV=$BASE.wav
DAT=$BASE.dat
#echo $BASE,$PNG,$WAV,$DAT
sox $WAV $DAT
grep -v '^;' $DAT >$DAT.clean
FREQ=`head -1 $DAT|tr -d ';'`
echo -e "set terminal png; set title '$FREQ';set output '$PNG'; plot '$DAT.clean' w l lt 2" | gnuplot