Script to Mute Windows' Volume
I want to write something that will mute the sound (on a Windows machine) after a certain period of time, either pre-set or user-defined. Basically it will work as a sleep timer. I am pretty familiar with Python, but not too much else. So I would prefer to use Python. I couldn't find any modules in the docs, however, that would allow this type of interfacing with Windows' audio control.
Any suggestions on how to do this would be good. Or if you know of an mp3 playing program that has 'sleep timer' functionality built in, let me know. Thanks. |
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.
Code:
import Tkinter Code:
import mute |
All times are GMT -5. The time now is 01:23 AM. |