ActiveState Code

Recipe 206549: Check your Windows sound system


Find out if the sound hardware on your windows PC is working properly.

Python
1
2
3
4
5
6
7
import winsound

try:
    winsound.PlaySound("*", winsound.SND_ALIAS)
    print 'Sound hardware is OK'
except RuntimeError, e:
    print 'Sound hardware has problem,', e

Sign in to comment