The Artima Developer Community
Sponsored Link

Python Buzz Forum
Gstreamer based python audio player in no time

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Philippe Normand

Posts: 78
Nickname: philn
Registered: Aug, 2005

Philippe Normand is a developer
Gstreamer based python audio player in no time Posted: Feb 24, 2006 3:56 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Philippe Normand.
Original Post: Gstreamer based python audio player in no time
Feed Title: Base-Art / Python
Feed URL: http://base-art.net/Sections/5/rss.xml
Feed Description: Phil's blog
Latest Python Buzz Posts
Latest Python Buzz Posts by Philippe Normand
Latest Posts From Base-Art / Python

Advertisement

Gstreamer based python audio player in no time

I'm learning to develop with Gstreamer 0.10 framework, which natively comes with Python binding, which is rare enough to notice for a project.

So, starting an audio player is quite simple:

  • create a player from the GstElement factory
  • give your file uri to the player and set it to play
  • start a loop (i used gobject here, but it should work with gtk.main() or a while-true loop)

Here is the code:

import pygst
pygst.require('0.10')
import gst
import gobject, sys

def play_uri(uri):
    " play an uri like file:///home/foo/bar.mp3 "

    mainloop = gobject.MainLoop()
    player = gst.element_factory_make("playbin", "player")
  
    print 'Playing:', uri
    player.set_property('uri', uri)
    player.set_state(gst.STATE_PLAYING)

    mainloop.run()

Ok, this is a start, now i need to:

  • get status information
  • seek + / -
  • play/pause/stop
  • manage a playing queue
  • manage video playing

So things will be a bit more complicated in a moment ;)

Read: Gstreamer based python audio player in no time

Topic: Datacenter move Previous Topic   Next Topic Topic: Guido-NYC

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use