Commit 833b2b80 authored by Arnaud Blanchard's avatar Arnaud Blanchard

Fix argument parsing

parent 1b36142d
......@@ -22,7 +22,6 @@ blaar_add_option size s "" "integer" "number of items per buffer" "4096"
blaar_add_option samplerate S "" "integer" "Samplerate of the sound acquisition" "44100"
blaar_parse_args "$@"
[ $filename ] && file_option="--file=$filename" || file_option=""
[ $output ] && output_option="--output=$output"|| output_option=""
if [ $filename ]; then
......
......@@ -24,21 +24,20 @@ blaar_add_option device D "" "device_name" "device to use for the speaker"
blaar_add_option filename f "" "filename" "file to save the sound to"
blaar_add_option size s "" "integer" "number of items per buffer" "4096"
blaar_add_option samplerate S "" "integer" "samplerate of the sound export" "44100"
blaar_add_parameter sound "blc_channel-in" "sound todiffuse"
blaar_add_parameter sound "blc_channel-in" "1" "sound to diffuse"
blaar_parse_args "$@"
[ $filename ] && file_option="-f=$filename" || file_option=""
if [ $filename ]; then
echo "to '$filename'" >&2
[ $device ] && { echo "You cannot have file (-f $filename) and speaker (-D $device) at the same time"; exit 1; }
blaar_module sndfile o_sndfile --file=$filename --size=$size --samplerate=$samplerate
o_sndfile --file=$filename --size=$size --samplerate=$samplerate $sound
elif [ $(uname) = "Darwin" ]; then #microphone
echo "to coreaudio speaker" >&2
blaar_module coreaudio o_coreaudio
o_coreaudio $sound
elif [ $(uname) = "Linux" ]; then
echo "to ALSA speaker" >&2
blaar_module asound o_asound
o_asound $sound
else
echo "$blaar_program_name does not work on '$(uname)' platform"
exit 1
......
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