Commit dfb43b68 authored by Arnaud Blanchard's avatar Arnaud Blanchard

Imporve error management in scripts. Improve examples doc

parent d44f2c3b
......@@ -14,6 +14,8 @@ Display the graph of the microphone
e_graph_sound.sh
![image](http://blaar.org/images/examples/graph_microphone.png)
Record the microphone in a file
i_sound.sh | o_sound.sh --file=toto.wav
......@@ -30,13 +32,12 @@ Graph a pure sinusoĩd at 440Hz (La)
e_graph_sound.sh -F440
![image](http://blaar.org/images/examples/graph_440Hz.png)
Play the 'La' in the speaker
i_sound.sh -F440 | o_sound.sh
![image](http://blaar.org/images/examples/graph_440Hz.png)
Spectrum (fft)
--------------
......
......@@ -39,7 +39,7 @@ blaar_module(){
[ $# -lt 2 ] && { echo "You need at least 2 arguments but you have $#:'$*'"; usage; exit 1; }
hash $2 2>/dev/null || { echo "You need to install https://gitlab.blaar.org/$1"; exit 2; }
hash $2 2>/dev/null || { echo; echo "Fail to execute '$*'" ; echo "You need to install https://framagit.org/blaar/$1"; echo; exit 2; }
shift
test_run "$@"
......
......@@ -32,7 +32,7 @@ blaar_parse_args "$@"
[ $frequency ] && frequency_option="-F$frequency" || frequency_option=""
i_sound.sh -S$samplerate -s$size -o.sound$$ $file_option $device_option $frequency_option |
o_gnuplot --label-max=$(calc "$size/$samplerate*1000") --text="set xlabel 'Time (ms)';set ylabel 'Amplitude'" --min=-$(calc 1/$gain) --max=$(calc 1/$gain) $xmax_option
blaar_module o_gnuplot o_gnuplot --label-max=$(calc "$size/$samplerate*1000") --text="set xlabel 'Time (ms)';set ylabel 'Amplitude'" --min=-$(calc 1/$gain) --max=$(calc 1/$gain) $xmax_option
#specify the output names allows you to erase them later
#remove the used blc_channels
......
......@@ -33,7 +33,7 @@ blaar_parse_args "$@"
[ $frequency ] && frequency_option="-F $frequency" || frequency_option=""
i_spectrum.sh -s$size $file_option $device_option $frequency_option -o:spectrum$$ |
o_gnuplot --label-max=$(calc "$samplerate/2") --text="set xlabel 'Frequencies (Hz)';set ylabel 'Amplitude'" $max_option $xmax_option
blaar_module o_gnuplot 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