Phonon error: libv4l2: error getting pixformat: Invalid argument

tausciam at gmail.com tausciam at gmail.com
Tue Aug 27 20:56:44 EDT 2013


I've played around with it and got code that plays mp3s now. I'm not sure what I was doing wrong.... or why it plays now...but it does, so I'm going to use it:

#!/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.sources = "/home/tannhaus/Music/A Perfect Circle/eMOTIVE/02 Imagine.mp3"
        self.mediaObject = Phonon.createPlayer(Phonon.MusicCategory)
        self.audioOutput = Phonon.AudioOutput(Phonon.MusicCategory, self)
        Phonon.createPath(self.mediaObject, self.audioOutput)
        self.mediaObject.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