Changing sound volume
Lenard Lindstrom
len-l at telus.net
Mon Jun 25 14:13:59 EDT 2007
simon kagwe wrote:
>> And finally a way that might work using ctypes:
>>
>> http://mail.python.org/pipermail/python-win32/2006-March/004436.html
>>
>> Mike
>
> Hi,
>
> Thanks for your reply.
>
> I had already read about the Snack, but I can't use it since my program uses
> wxPython for the GUI and Snack requires tk. The best option was the ctypes
> method you told me about. I used the code in the sample, but I am getting the
> following error:
>
> exceptions.WindowsError Error 11 while setting volume
>
> The author of the code claims it works. What could be causing the above error?
>
> [ I am using Python 2.4.4 and ctypes 1.0.1 ]
>
That module looks suspiciously like one I have laying around on my
computer. That's okay since I had posted it somewhere. Try setting
SPEAKER_LINE_FADER_ID to 0. Apparently my assumption that it is always 0
was wrong. If that works I have a more flexible version of the module
which actually searches for the speak line fader id. It also has a
GetSpeakerVolume function.
---
Lenard Lindstrom
<len-l at telus.net>
More information about the Python-list
mailing list