| The Following 4 Users Say Thank You to pichlo For This Useful Post: | ||

| The Following User Says Thank You to juiceme For This Useful Post: | ||
| The Following User Says Thank You to pichlo For This Useful Post: | ||
| The Following User Says Thank You to nokiabot For This Useful Post: | ||
| The Following User Says Thank You to juiceme For This Useful Post: | ||
#!/bin/bash
# A simple script to record some sound, wait a bit
# and play it back. Like a talking parrot.
# Takes two command-line parameters:
# $1 ... how long to record
# $2 ... how long to wait before playback
# Work out the file name based on current date/time
fpath=/home/user/MyDocs/.sounds/Recordings
fflag=$fpath/Parrot-in-use
fname=$fpath/Parrot-`date +%Y%m%d-%H%M%S`.raw
# Prevent multiple parallel instances
if [ -e "$fflag" ] ; then
exit 0
fi
touch $fflag
# Display notification banner
banner()
{
o=org
f=freedesktop
n=Notifications
dbus-send --type=method_call --dest=$o.$f.$n \
/$o/$f/$n $o.$f.$n.SystemNoteInfoprint \
string:"Parrot $1..."
}
# Record...
banner "recording"
parec $fname &
sleep $1
killall parec
# ...wait a bit...
banner "waiting"
sleep $2
# ...and play it back
banner "playing"
pacat $fname
rm $fflag
Unfortunately other things got in the way and I could not proceed to the implementation for a while and then I forgot about it altogether. Now you've reminded me, I pretty much have to
| The Following 3 Users Say Thank You to pichlo For This Useful Post: | ||
| The Following 2 Users Say Thank You to gianko For This Useful Post: | ||