[Debian]Voice recorder - ecasound --> Help

Charles-Henri Gros charles-henri.gros+openmoko at m4x.org
Sat Feb 21 05:20:52 CET 2009


kimaidou wrote:
> I am answering myself here : I found the solution :you have to add a "&"
> at the end of the arecord line
> So the file content is now :
> 
> #!/bin/bash
> zenity --question --title="Voice-note" --text="Click Validate to START
> recording"; gostart=$?
> 
> if [ "$gostart" = 1 ]
>     then
>         echo "Operation canceled"
>         exit
>     else
>         echo "Recording..."
> fi
> arecord -D hw -f cd  -v -t wav ~/rec-$(date +%Y-%m-%d-%H-%M).wav &
> alsactl -f /usr/share/openmoko/scenarios/voip-handset.state restore &

This line should not end with '&' and should probably come before the
"arecord" line

> zenity --info --title="Voice-note" --text="Click Validate to STOP
> recording"; gostop=$?
> 
> killall -TERM arecord

You should use "kill %1" instead, this will only kill the instance you
just started (and TERM is the default). For that, you need to enable job
control (set -m)

> alsactl -f /usr/share/openmoko/scenarios/gsmhandset.state restore
> zenity --info --title="Voice note" --text="Your voice-note has been
> recorded"; goread=$?
> 
> #END OF FILE

Result:

#!/bin/bash
# Exit on error
# Enable job control
set -em
zenity --question --title="Voice-note" --text="Click Validate to START
recording"; gostart=$?

if [ "$gostart" = 1 ]
    then
        echo "Operation canceled"
        exit 1
    else
        echo "Recording..."
fi
alsactl -f /usr/share/openmoko/scenarios/voip-handset.state restore
arecord -D hw -f cd  -v -t wav ~/rec-$(date +%Y-%m-%d-%H-%M).wav &
zenity --info --title="Voice-note" --text="Click Validate to STOP recording"

# Kill arecord
kill %1
alsactl -f /usr/share/openmoko/scenarios/gsmhandset.state restore
zenity --info --title="Voice note" --text="Your voice-note has been
recorded"

#END OF FILE


-- 
Charles-Henri





More information about the community mailing list