Commit d151f298 authored by Arnaud Blanchard's avatar Arnaud Blanchard

Fixes #!/... bash calling and miscelleanous

parent 45cc9353
#!/usr/bin/env bash #Use your $PATH to find bash
#Use your $PATH to find bash
#!/usr/bin/env bash
# Basic Libraries And Applications for Robotics (BLAAR)
# Copyright ETIS — ENSEA, University of Cergy-Pontoise, CNRS (2011 - 2017)
......
#!/usr/bin/env bash #Use your $PATH to find bash
#Use your $PATH to find bash
#!/usr/bin/env bash
# Basic Libraries And Applications for Robotics (BLAAR)
# Copyright ETIS — ENSEA, University of Cergy-Pontoise, CNRS (2011 - 2017)
......
#!/usr/bin/env bash #Use your $PATH to find bash
#Use your $PATH to find bash
#!/usr/bin/env bash
# Basic Libraries And Applications for Robotics (BLAAR)
# Copyright ETIS — ENSEA, University of Cergy-Pontoise, CNRS (2011 - 2017)
......@@ -22,7 +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 output o "" "blc_channel|-" "output blc_channel name on terminal (-)"
blaar_add_option output o "" "blc_channel|-" "output on blc_channel or stdout(-)"
blaar_add_option size s "" "integer" "number of itmes per sample" "4096"
blaar_add_option samplerate S "" "integer" "Samplerate of the sound acquisition" "44100"
blaar_parse_args "$@"
......@@ -31,7 +32,7 @@ blaar_parse_args "$@"
[ $output ] && output_option="--output=$output"|| output_option=""
if [ $filename ]; then
echo "File input" >&2
echo "Loading '$filename" >&2
[ $device ] && { echo "You cannot have file (-f) and microphone (-D) at the same time"; exit 1; }
blaar_module.sh sndfile i_sndfile --file=$filename --size=$size --samplerate=$samplerate $output_option
elif [ $(uname) = "Darwin" ]; then #microphone
......
#!/usr/bin/env bash #Use your $PATH to find bash
#Use your $PATH to find bash
#!/usr/bin/env bash
# Basic Libraries And Applications for Robotics (BLAAR)
# Copyright ETIS — ENSEA, University of Cergy-Pontoise, CNRS (2011 - 2017)
......@@ -20,16 +21,20 @@ set -o pipefail #Error if a pipe fail
source blaar.sh
blaar_init_options "Acquire 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 output o "" "blc_channel|filename|-" "output of the data ('-' for stdout)"
blaar_add_option size s "" "integer" "number of items per sample" "4096"
blaar_add_option samplerate S "" "integer" "Samplerate of the sound acquisition" "44100"
blaar_parse_args "$@"
if [ $filename ]; then
blaar_module.sh sndfile i_sndfile --file=$filename -o:sound$$
else
i_microphone -o:sound$$
fi | blaar_module.sh fftw f_fftw_spectrum -o
[ $device ] && device_option="-D$device" || device_option=""
[ $filename ] && filename_option="-f$filename" || filename_option=""
[ $output ] && output_option="--output=$output" || output_option=""
i_sound.sh -o:sound$$ -s$size -S$samplerate $device_option $filename_option|
blaar_module.sh fftw f_fftw_spectrum $output_option
blc_channels --unlink /sound$$
#!/usr/bin/env bash #Use your $PATH to find bash
#!/usr/bin/env bash
# Basic Libraries And Applications for Robotics (BLAAR)
# Copyright ETIS — ENSEA, University of Cergy-Pontoise, CNRS (2011 - 2017)
......@@ -18,9 +18,9 @@ set -o nounset #Error if a variable is used but not defined
set -o pipefail #Error if a pipe fail
if [ $(uname) = "Darwin" ]; then
blaar_module coreaudio o_coreaudio "$@"
blaar_module.sh coreaudio o_coreaudio "$@"
elif [ $(uname) = "Linux" ]; then
blaar_module asound o_asound "$@"
blaar_module.sh asound o_asound "$@"
else
echo "$0 does not work on '$(uname)' platform"
fi
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