def has_sound(sound):
    try:
        # Ask the mixer API for the number of devices it knows about.
        # When there are no devices, PlaySound will fail.
        if ctypes.windll.winmm.mixerGetNumDevs() == 0:
            return False

        key = winreg.OpenKeyEx(winreg.HKEY_CURRENT_USER,
                "AppEvents\Schemes\Apps\.Default\{0}\.Default".format(sound))
        return winreg.EnumValue(key, 0)[1] != ""
    except WindowsError:
        return False
Find out if a particular event is configured with a default sound
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/test/test_winsound.py/has_sound