So, I am trying to play a sound in my application. Typically the sound needs to be played after a the end of a countdown and then user-interaction is stopped.
But, the problem is
self.setGeometry(300, 300, 200, 200)
self.btn = QtGui.QPushButton("Play", self)
c = QtGui.QSound("1.mp3")
You should call QSound.isAvailable() to check whether the necessary sound facilities are available on your platform (but note that this may produce a false positive on Windows).
When I try this on Linux, is prints
False, even though phonon is installed and I can play audio using the PyQt Phonon module.
This may be because I don't have NAS support built in (I haven't checked), which is the key requirement that determines availability on X11. For other platforms, see the Detailed Description for QSound - in particular, note that QSound will only play WAV files on Windows.