View Single Post
Posts: 482 | Thanked: 550 times | Joined on Oct 2010
#31
Code:
import gst
import time
import os

bin = gst.element_factory_make("camerabin")
bin.set_property("audioenc", gst.element_factory_make("nokiaaacenc"))

while True:
    bin.set_state(gst.STATE_PLAYING)
    bin.set_property("filename", "current.aac")
    bin.set_property("mode",1)
    #starts recording
    bin.emit("user-start")

    time.sleep(60)

    # stops recording
    bin.emit("user-stop")
    bin.set_state(gst.STATE_PAUSED)
    bin.set_state(gst.STATE_NULL)
    try:
        os.remove("twominutesold.aac")
    except OSError:
        print "No two-minutes-old file exists yet."
    try:
        os.rename("oneminuteold.aac", "twominutesold.aac")
    except OSError:
        print "No one-minute-old file exists yet."
    os.rename("current.aac", "oneminuteold.aac")
I think this should work to record just audio.
 

The Following 2 Users Say Thank You to skykooler For This Useful Post: