Vista Audio Control Functions & #Warn

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
TheBestPessimist
Posts: 21
Joined: 08 Apr 2018, 02:14

Vista Audio Control Functions & #Warn

08 Feb 2019, 10:44

[Moderator's note: Topic moved from Scripts & Functions.]

Hey folks,

In my scripts (and because windows is retarded) i am using the Vista Audio Control Functions (Ref: https://autohotkey.com/board/topic/21984-vista-audio-control-functions/).
As i'm trying to check my scripts using the #Warn directive, ahk shows a lot of messages coming from this library.

Is there an updated version of this library anywhere which has fixed the warnings and possibly also is compatible with AHK 2?

What i'm doing basically is always set the correct sound balance after turning the volume to 0, since in that case windows is "smart" and resets the balance to default (Ref: https://github.com/TheBestPessimist/AutoHotKey-Scripts/blob/master/SoundBalance.ahk)
Last edited by TheBestPessimist on 06 Jul 2019, 01:32, edited 3 times in total.
gregster
Posts: 9001
Joined: 30 Sep 2013, 06:48

Re: Vista Audio Control Functions

08 Feb 2019, 11:51

I don't think anyone would want to fix the #warn-ings for this library, or most other working scripts/libs (that said, it probably shouldn't be too hard, if you want to try it: in this case, probably mostly un-initialized local variables are causing them) - as they are most likely irrelevant.

As long as the library is running fine, you can ignore them. You can have a rock solid script with lots of warnings that is much more stable than some other script without any warnings. These warnings tell you only a limited story about any given script. There are many other factors that influence the actual quality of a script.
For debugging, they might have a certain, limited value, though.

Afaik, there is no v2 version of it, so far... but perhaps someone has an (unposted) version already lying around.

I would recommend to use the 'Ask for Help' subforum next time, for questions like this.
TheBestPessimist
Posts: 21
Joined: 08 Apr 2018, 02:14

Re: Vista Audio Control Functions

12 Feb 2019, 13:24

> probably mostly un-initialized local variables are causing them

Yes, that's (almost?) all the errors i'm seeing.

If you think there are no problems then i'm fine with that as yes, the library works for what i need it :).

> I would recommend to use the 'Ask for Help' subforum next time, for questions like this.

Thanks for the tip. Not sure where i'm supposed to post stuff, so i expect mods to just move my post as/if needed.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Vista Audio Control Functions & #Warn

05 Jul 2019, 21:04

I haven't used the script, or even SoundSet/SoundGet in a long time, so haven't updated it. I may try to add some of the missing capabilities to SoundSet/SoundGet v2 when I get around to revising them.
TheBestPessimist wrote:
08 Feb 2019, 10:44
What i'm doing basically is always set the correct sound balance after turning the volume to 0, since in that case windows is "smart" and resets the balance to default (Ref: [broken link])
It's not Windows being "smart". (Im)balance is set by increasing or decreasing the level of some channels independently of the others, so when all channels are zero, the balance is necessarily centered. If you look in VA_SetVolume, you should see that it has to explicitly scale the value of each channel in order to retain balance. Even in the Sound control panel, the Balance button next to each component just lets you adjust the level of each channel independently.

But you probably knew some of that if you were setting balance (hard to tell since your link was broken).
TheBestPessimist
Posts: 21
Joined: 08 Apr 2018, 02:14

Re: Vista Audio Control Functions & #Warn

06 Jul 2019, 01:40

But you probably knew some of that if you were setting balance (hard to tell since your link was broken).
I updated the link: https://github.com/TheBestPessimist/AutoHotKey-Scripts/blob/master/SoundBalance.ahk

Yeah, i knew that stuff about the balance. My issue is: since i have gone out of my way to set the channels to some particular levels, compared to each other, that means that i **am interested** in having that setting remembered (it takes like friggin 20 clicks to reach that menu when you know exactly where it is, so by all means it's not a simple process). Well, windows just doesn't care and when i turn the (master) volume down to 0 (which may happen for thousands of reasons -- that's not something that needs explanation), the next time i turn the volume back up, every channl is set to the same level. This is wrong, bad and stupid from a user's perspective (and i am a user, not a system gui who's supposed to debug and fix these kinds of problems) because i really want my sound balance to be at the same % as i set it previously.

And it's not like windows can't compute that balance, since even going to volume = 1 then going back to 100 keeps the % scaled correctly.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Vista Audio Control Functions & #Warn

13 Jul 2019, 21:10

TheBestPessimist wrote:
06 Jul 2019, 01:40
And it's not like windows can't compute that balance, since even going to volume = 1 then going back to 100 keeps the % scaled correctly.
When you raise the volume of one channel above the others, Control Panel shows that as the new "master volume". If you raise the master volume to 100, only the loudest channel is actually raised to 100. The rest are raised proportionately.

Basically, the "balance" setting does not exist. All you have is a volume level for each channel, and a master control that manipulates them all at once. You don't set the balance; you set a level for each channel. Those settings are remembered, until you change them. If you set all channels to 0, that's remembered too.

If you manage the sound settings through your own scripts, you can do whatever you want, including saving the balance separately to the volume.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: rc76 and 211 guests