SetMasterVolume in Windows 7

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
GoldenEye
Posts: 6
Joined: Thu Jun 30, 2011 3:25 pm

SetMasterVolume in Windows 7

Post by GoldenEye » Thu Dec 22, 2011 4:05 pm

I'd like to set my media center's volume level to a value which is stored in a variable.

Unfortunately, the python command eg.WinApi.SoundMixer.SetMasterVolume(77%, 0) produces the following error:

eg.WinApi.SoundMixer.SetMasterVolume(77%, 0)
Error in Action: "eg.WinApi.SoundMixer.SetMasterVolume(77%, 0)"
Traceback (most recent call last) (1534):
File "<string>", line 1
eg.WinApi.SoundMixer.SetMasterVolume(77%, 0)
^
SyntaxError: invalid syntax


Do you know the correct syntax?

Thx, G.

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: SetMasterVolume in Windows 7

Post by Pako » Thu Dec 22, 2011 4:42 pm

Code: Select all

eg.WinApi.SoundMixer.SetMasterVolume(77,0)
Pako

GoldenEye
Posts: 6
Joined: Thu Jun 30, 2011 3:25 pm

Re: SetMasterVolume in Windows 7

Post by GoldenEye » Thu Dec 22, 2011 11:35 pm

Thanks a lot, Pako.

Calliope99
Posts: 3
Joined: Wed Jan 04, 2012 1:54 pm

Re: SetMasterVolume in Windows 7

Post by Calliope99 » Thu Jan 05, 2012 4:42 am

I installed the latest Creative sound drivers for my XFi, but i cant find the master volume control. All i find is a volume mixer. I usually would not care about this, but the sound is lower now than it used to be in win XP. So that probably means that the Wave volume control at the master volume control is at like 75%, but since i for some reason dont have master volume control i dunno how to increase the wave sound to 100%.

Does any1 have any idea? I heard that if u set winamp to 100% that it will increase the wave volume as well. Could any1 with win7 test that or help me increase my wave volume?

I tried to download an alternative maser volume control but that didnt work.

Post Reply