On Wed, Jan 20, 2016 at 03:37:36AM +0100, Thor Andreassen wrote:

[...]

> A crude way of getting the raw numbers could be to use the color values
> from the generated png file, e.g. with Imagemagick:
> 
>     sox -n -n synth 1 synth 1k:5k spectrogram -r -o - |
>     convert png:- txt:-                 |
>     
>     # translate into Gnuplot compatible input
>     awk -v FS='[,:() ]+' 'NR > 2               { print $1, $2, ($3+$4+$5)/3 
> }'  |
>     awk                  'NR > 2 && $2 != prev { printf "\n" } { prev = $2 } 
> 1' \
>     > spectrogram.dat

With the rgbimage feature of Gnuplot, you can actually access the pixels
directly, e.g.:

    echo "plot 'spectrogram.png' binary filetype=png 
format='%uchar%uchar%uchar' \
           using 1:2:3 with rgbimage" | gnuplot --persist

Or if you want to set the red channel to zero:

    echo "plot 'spectrogram.png' binary filetype=png 
format='%uchar%uchar%uchar' \
           using (0):2:3 with rgbimage" | gnuplot --persist

[...]

-- 
best regards
Thor Andreassen

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

Reply via email to