Play Wave Sound Files with PySide/PyQT

vegaseat 1 Tallied Votes 3K Views Share

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

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.