Code: Select all
screenres 800,600,32 'open a window
print "Lazy mans way to record sound and capture an image from the webcam."
print "-------------------------------------------------------------------"
print
print "Starting a 5 minute audio grab."
print
shell "arecord -D hw:0,0 -d 300 -t wav -c 2 -r 44100 -f S16_LE sound_grab.wav &" '& = contine without waiting
'start audio recording and return
'https://linux.die.net/man/1/arecord
print "Getting sound from front microphone."
print
print "Grabbing an jpeg image from the webcam just for fun."
print
shell "streamer -s 640X480 -o myimage.jpeg &" 'grab image from webcam
'https://linux.die.net/man/1/streamer
print "I could be doing something else, but for now I'll just take a nap..."
print
sleep 12000
print "I'm awake!"
print
shell "killall -I ARecord" 'kill process by name.
'https://linux.die.net/man/1/killall
print "I killed the sound recording but kept what I got up to that point."
print
print "What the hey, lets listen to what we've got."
print
shell "aplay sound_grab.wav" 'play wav recording
'https://linux.die.net/man/1/aplay
print
print "I'm done! Hit any key to exit"
sleep