ok quick lesson
if you click on the Help menu then click on python shell...
once the shell opens you will want to type in
then you will see the help prompt
once you see that type in
Code: Select all
eg.WinApi.SoundMixer.GetMasterVolume
and press enter.
if there is documentation on the item it will display it. if not it will show you what parameters need to be passed to it.
so in this example this is what is shown. eg.WinApi.SoundMixer.GetMasterVolume = GetMasterVolume(deviceId=0)
we are interested in the goodies between the () which is deviceid=0 so now we know that it takes a parameter that identifies the device. and that the default value is 0 so by not providing an id it will use 0. and apparently you do not have a sound device with the id of 0. so start going through the numbers.
Code: Select all
for i in range(10):
try:
volume = eg.WinApi.SoundMixer.GetMasterVolume(i)
print 'deviceid:', str(i), ' Volume:', str(volume)
except:
pass
this will print off the deviceid and the volume if there is a device at that number.. and from there you can do whatever it is you want to do with it. this will only try numbers 0-9
On another note. simply putting the function into a python command even if it did work is not going to do anything for you. you will need to put the value into a variable for later use or print it out.
Code: Select all
eg.result = eg.WinApi.SoundMixer.GetMasterVolume(5)