Commit 234392b7 authored by Arnaud Blanchard's avatar Arnaud Blanchard

Add device option for alsa micro and add Amplitude label in

parent fe6eb524
......@@ -21,7 +21,7 @@ set -o pipefail #Error if a pipe fail
blaar_init_options "Graph the frequency spectrum from the microphone or a sound file(-f)"
blaar_add_option device_option D "" "device_name" "device to use for the microphone"
blaar_add_option device D "" "device_name" "device to use for the microphone"
blaar_add_option filename f "" "filename" "file to load the sound from"
blaar_add_option size s "" "integer" "number of itmes per sample" "4096"
blaar_add_option samplerate S "" "integer" "Samplerate of the sound acquisition" "44100"
......@@ -29,12 +29,14 @@ blaar_add_option max M "" "real" "maximal intensity to display"
blaar_add_option xmax X "" "real" "maximal values on absisca to display"
blaar_parse_args "$@"
[ $device ] && device_option="-D $device" || device_option=""
[ $filename ] && file_option="-f=$filename" || file_option=""
[ $max ] && max_option="--max=$max" || max_option=""
[ $xmax ] && xmax_option="--xmax=$xmax" || xmax_option="" -s$size $file_option $device_option -o.spectrum$$ |
o_gnuplot --label-max=$(calc "$samplerate/2") --text="xlabel 'Frequencies (Hz)'" $max_option $xmax_option
o_gnuplot --label-max=$(calc "$samplerate/2") --text="set xlabel 'Frequencies (Hz)';set ylabel 'Amplitude'" $max_option $xmax_option
#specify the output names allows you to erase them later
#remove the used blc_channels
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment