Play Wave Sound Files with PySide/PyQT


The PySide (PyQT) GUI toolkit can be used to play wave sound files.

About the Author


a simple template to test PySide widgets like QSound

PySide is the official LGPL-licensed version of PyQT
for free PySide Windows installers see:
tested with Python33 and Pyside112  by vegaseat  29jul2013

import time
from PySide.QtCore import *
from PySide.QtGui import *

# replace [] with sys.argv for command line option
app = QApplication([])

# ----- start your widget test code ----

# pick a sound file (.wav only) you have
sound_file = "Pop.wav"

# create a label to show file (allows for proper exit too)
label = QLabel(sound_file)

# ---- end of widget test code -----

vegaseat 1,735 DaniWeb's Hypocrite Team Colleague

Mac OS X All sound file formats that NSSound supports, including QuickTime formats.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.