I'm not aware of any "easy" way to truly mute the device. However, following is a script with will set the volume for the windows Wave device to 0, which for me will essentially "mute" the audio output. To use the below script, just call the Mute() function with either True or False. You will also need to have tkSnack installed. It is available here
. If anyone else has any better methods as to acheiving this goal, I'd be very interested to see them. Also, I believe pyGame has got some sound functions, but I did not look at them indepth.
root = Tkinter.Tk()
if boolean is True:
original = tkSnack.audio.play_gain()
print "the original before mute is:", original
elif boolean is False:
g = globals()
if (tkSnack.audio.play_gain() == 0) and (g.has_key('orignal')):
elif tkSnack.audio.play_gain() == 0:
Below is a small driver program:
quit = 0
while quit == 0:
print "(1) Mute Sound"
print "(2) Unmute Sound"
print "(3) Quit"
choice = input("Choice: ")
if choice == 1:
elif choice == 2:
elif choice == 3:
print "You have made an invalid selection"