From f0ff76ceb2e5e43f865aea76f5915fac77de07a4 Mon Sep 17 00:00:00 2001 From: Xiangfu Liu Date: Tue, 6 Mar 2012 18:28:58 +0800 Subject: [PATCH] nanonote-files: add wav2png simple script file --- nanonote-files/script-files/usr/bin/wav2png | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 nanonote-files/script-files/usr/bin/wav2png diff --git a/nanonote-files/script-files/usr/bin/wav2png b/nanonote-files/script-files/usr/bin/wav2png new file mode 100755 index 0000000..d98adcd --- /dev/null +++ b/nanonote-files/script-files/usr/bin/wav2png @@ -0,0 +1,14 @@ +#!/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'" | gnuplot