Commit fe6eb524 authored by Arnaud Blanchard's avatar Arnaud Blanchard

Add the possibility to generate pure frequecy with i_sound.h

parent af776aea
......@@ -23,6 +23,7 @@ source blaar.sh
blaar_init_options "Acquire the sound from microphone or sound file (-f filename)"
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 frequency F "" "frequency" "frequency of a pure sound"
blaar_add_option output o "" "blc_channel|-" "output on blc_channel or stdout(-)"
blaar_add_option size s "" "integer" "number of items per buffer" "4096"
blaar_add_option samplerate S "" "integer" "Samplerate of the sound acquisition" "44100"
......@@ -33,8 +34,12 @@ blaar_parse_args "$@"
if [ $filename ]; then
echo "Loading '$filename" >&2
[ $frequency ]&&{ echo "You cannot have file (-f) and frequecy (-F) at the same time"; exit 1; }
[ $device ] && { echo "You cannot have file (-f) and microphone (-D) at the same time"; exit 1; }
blaar_module sndfile i_sndfile --file=$filename --size=$size --samplerate=$samplerate $output_option
elif [ $frequency ]; then
echo "Generating sinusoïd at $frequency Hz" >&2
i_oscillator --frequency=$frequency --size=$size --refresh=$(calc $size/$samplerate*1000) $output_option
elif [ $(uname) = "Darwin" ]; then #microphone
echo "Coreaudio microphone" >&2
[ $device ] && echo "On Darwin you cannot precise microphone (-D)"
......
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