I am answering myself here : I found the solution :you have to add a &quot;&amp;&quot; at the end of the arecord line<br>So the file content is now :<br><br>#!/bin/bash<br>zenity --question --title=&quot;Voice-note&quot; --text=&quot;Click Validate to START recording&quot;; gostart=$? <br>
<br>if [ &quot;$gostart&quot; = 1 ]<br>&nbsp;&nbsp;&nbsp; then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo &quot;Operation canceled&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo &quot;Recording...&quot;<br>fi<br>arecord -D hw -f cd&nbsp; -v -t wav ~/rec-$(date +%Y-%m-%d-%H-%M).wav &amp;<br>
alsactl -f /usr/share/openmoko/scenarios/voip-handset.state restore &amp;<br>zenity --info --title=&quot;Voice-note&quot; --text=&quot;Click Validate to STOP recording&quot;; gostop=$? <br><br>killall -TERM arecord<br>alsactl -f /usr/share/openmoko/scenarios/gsmhandset.state restore<br>
zenity --info --title=&quot;Voice note&quot; --text=&quot;Your voice-note has been recorded&quot;; goread=$? <br><br>#END OF FILE<br><br>CONCLUSION<br>It works well !! For those who want to try, just create a executable text file called &quot;voicenote.sh&quot; for example in your personnal folder and add the lines above. <br>
To make it executable, please do :<br>chmod +x ~/voicenote.sh<br><br>Thanks all for your help !<br><br>Kimaidou<br><br><br><br>