O'Reilly logo

Python Multimedia Beginner's Guide by Ninad Sathaye

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - developing the audio player code

The source file, AudioPlayerDialog.py, used in the earlier section will be used here as well. The class AudioPlayerDialog inherits QMainWindow.

  1. If you have not done so already, download the Python source file AudioPlayerDialog.py.
  2. Let's start with the constructor of the class, AudioPlayerDialog.
    1 def __init__(self): 2 QMainWindow.__init__(self) 3 self.mediaSource = None 4 self.audioPath = '' 5 self.addedEffects = {} 6 self.effectsDict = {} 7 8 # Initialize some other variables. 9 self._filePath = '' 10 self._dirPath = '' 11 self._dialog = None 12 # Create media object , audio sink and path 13 self.mediaObj = phonon.Phonon.MediaObject(self) 14 self.audioSink = Phonon.AudioOutput( 15 Phonon.MusicCategory, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required