Grabbing images and sound

Linux specific questions.
TrikeTrash
Posts: 3
Joined: May 19, 2015 4:04

Grabbing images and sound

Postby TrikeTrash » Feb 28, 2019 13:58

I've finally broke the glass and climbed out of windows. My biggest concern was the ability recreate audio and video grabbing as I play around a lot with media and the like. Anyway, since it took me all @#$% day to figure out and it was so @#$% simple to do, I thought I'd share...

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

Return to “Linux”

Who is online

Users browsing this forum: No registered users and 0 guests