Phonon error: libv4l2: error getting pixformat: Invalid argument

tausciam at gmail.com tausciam at gmail.com
Tue Aug 27 20:42:19 EDT 2013


When I pare down the code to the following, I can't hear the mp3 play either:

#!/usr/bin/env python

import sip
sip.setapi('QString', 2)

import sys

from PyQt4 import QtCore, QtGui
from PyQt4.phonon import Phonon



class MainWindow(QtGui.QMainWindow):
    def __init__(self):
        super(QtGui.QMainWindow, self).__init__()       
        self.audioOutput = Phonon.AudioOutput(Phonon.MusicCategory, self)
        self.mediaObject = Phonon.MediaObject(self)
        self.metaInformationResolver = Phonon.MediaObject(self)
        Phonon.createPath(self.mediaObject, self.audioOutput)
        self.sources = "/home/tannhaus/Music/A Perfect Circle/eMOTIVE/02 Imagine.mp3"
        self.metaInformationResolver.setCurrentSource(Phonon.MediaSource(self.sources))
        self.mediaObject.play()

if __name__ == '__main__':
    app = QtGui.QApplication(sys.argv)
    app.setApplicationName("Music Player")
    app.setQuitOnLastWindowClosed(True)

    window = MainWindow()
    window.show()

    sys.exit(app.exec_())



More information about the Python-list mailing list