Trent Mick wrote: > Does anybody know of a way to programmatically check if a particular > Windows box has a soundcard installed and configured? > > Background: > I'm running a Windows buildbot for Python and the test suite fails on > test_winsound.py because the box doesn't have a sound card setup. (The > "Sound" Control Panel items says there are "No Playback Devices" for > Sound Playback.)
WMI can list sound devices. import win32com.client wmi=win32com.client.GetObject('winmgmts:') scs=wmi.InstancesOf('win32_sounddevice') for sc in scs: print sc.Properties_('Name'), sc.Properties_('Status') You might also have to check one of the other properties to make sure the device is actually operating, I don't have a non-functional device to test with. Roger _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32