gst-fractions the bane of my existence
[python-gstreamer-examples] / example0.py
1 #!/usr/bin/env python
2 # An even simpler gstreamer example, omitting all that class stuff
3
4 import gi
5 gi.require_version('Gst', '1.0')
6 from gi.repository import Gst
7
8 # Create the gstreamer pipeline
9 Gst.init(None)
10 pipeline = Gst.Pipeline()
11
12 # Audio source (src)
13 audio = Gst.ElementFactory.make("audiotestsrc")
14 pipeline.add(audio)
15
16 # Audio output (sink)
17 pulsesink = Gst.ElementFactory.make("pulsesink")
18 pipeline.add(pulsesink)
19
20 # Link our two elements together
21 audio.link(pulsesink)
22
23 # Start the pipeline
24 pipeline.set_state(Gst.State.PLAYING)
25
26 # Something to do while the pipeline is playing
27 input()