import pygtk
pygtk.require('2.0')
import gobject

import pygst
pygst.require('0.10')
import gst

# Construct new pipeline
pipeline = gst.parse_launch("""
	adder name=add ! audio/x-raw-int,rate=16384,with=64,channels=1 ! fakesink
	audiotestsrc samplesperbuffer=4096 ! add.
	audiotestsrc samplesperbuffer=128 ! add.
""")

def probe(pad, buf):
	print buf.timestamp, buf.duration, buf.offset, buf.offset_end
	return True

pipeline.get_by_name('add').src_pads().next().add_buffer_probe(probe)

# Go!
pipeline.set_state(gst.STATE_PLAYING)
gobject.MainLoop().run()
