I been trying all day to figure out the Qt\'s Phonon library with Python.
My long term goal is to see if I could get it to play a mms:// stream, but since I can\'t find
In delayedInit
method; create MediaObject
like following:
def delayedInit(self):
if not self.m_media:
self.m_media = Phonon.createPlayer(Phonon.MusicCategory)
Phonon supports different audio file formats on different platforms, using the system's own support for media formats, so it could be that your system doesn't provide libraries for playing MP3 files. Certainly, MP3 is not supported out of the box on some Linux distributions. If you are using Linux, please take a look at the following page for information about enabling MP3 support:
http://doc.qt.io/qt-4.8/phonon-overview.html#linux
Another way to diagnose problems with Phonon's media formats is to run the Capabilities example provided with Qt:
http://doc.qt.io/qt-4.8///qt-phonon-capabilities-example.html
This should tell you which media formats are supported by your system.
If Phonon is not outputting audio or video, but not throwing any errors. You might just have to sudo apt-get install phonon-backend-gstreamer
and also maybe sudo apt-get install libphonon-dev
Phonon uses a backend of gstreamer or vlc silently, so when its not there, no errors but no functionality either. after running those commands I was able to hear sound from phonon on my raspberry pi
Hopefully this will help someone in the future.