#!/usr/bin/python

from gi.repository import Gst, Gtk

def bus_eos(bus, message):
	Gtk.main_quit()
	return

Gst.init(None)
pipe = """filesrc name=src ! decodebin ! audioconvert ! fakesink"""
loadingPipeline = Gst.parse_launch(pipe)
filesrc = loadingPipeline.get_by_name("src")
filesrc.set_property("location", "/home/peteris/Codex.wav")
loadingPipeline.set_state(Gst.State.PLAYING)
bus = loadingPipeline.get_bus()
bus.add_signal_watch()
bus.connect("message::eos", bus_eos)
Gtk.main()
