Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

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 »

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 »

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 »

Thanks a lot, Pako.
Calliope99
Posts: 3
Joined: Wed Jan 04, 2012 1:54 pm

Re: SetMasterVolume in Windows 7

Post by Calliope99 »

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