|
|
2011-06-28
, 12:55
|
|
Posts: 20 |
Thanked: 16 times |
Joined on Jun 2010
|
#2
|

#!/usr/bin/env python
import gst
import gobject
player = gst.element_factory_make("playbin2", "player")
vis = gst.element_factory_make("goom","vis")
videosink = gst.element_factory_make("fakesink", 'videosink')
videosink.set_property('async', False)
audiosink = gst.element_factory_make("autoaudiosink", 'audiosink')
audiosink.set_property('async-handling', True)
player.set_property("vis-plugin", vis)
player.set_property("video-sink", videosink)
player.set_property("audio-sink", audiosink)
player.set_property("uri", 'file:///home/user/MyDocs/test.mp3') #exchange with your own file
player.set_state(gst.STATE_PLAYING)
gobject.MainLoop().run()
|
|
2011-06-28
, 13:51
|
|
|
Posts: 2,121 |
Thanked: 1,540 times |
Joined on Mar 2008
@ Oxford, UK
|
#3
|
| The Following User Says Thank You to pelago For This Useful Post: | ||
|
|
2011-06-28
, 16:53
|
|
Posts: 20 |
Thanked: 16 times |
Joined on Jun 2010
|
#4
|
I'm trying to write an alarm clock application in python using pyqt.
I've managed to get audio files to play, using mplayer at the moment. However, there's one quite annoying problem: Whenever the power button is pressed, the playback pauses for about a second, and then continues in most cases. Even more annoying, sometimes mplayer seems to choke on the forced pause and doesn't continue playing at all.
I was trying to use gstreamer instead, but the simple pygst program from the official pygst tutorial seems to exhibit the same behaviour, i.e. it pauses for a second when the power button is pressed.
As the official N900 media player also uses gstreamer afaik and doesn't pause when the power button is pressed, I guess there is a way to prevent this from happening.
Any help would be greatly appreciated.
Regards,
Eagle_Linux