Jump to content

Determine Current Sound Volume


Recommended Posts

Short Story:

App uses traytip to provide visual notification. When this happens via au3, it includes an annoying beep.

Desire to stop the annoying beep.

One way of doing this would be to set the sound volume to zero on execution, and reset it at script completion.

Unfortunately, I don't see a way in au3 to detect the current system volume level , such that I can save / restore it as desired.

Suggestions to solve this issue by eliminating the beep in the first place and / or being able to save the current volume welcomed.

As I write this , it strikes me that a mute / unmute function would also suffice, were there a nice way to do so.

Would love to have a solution for the most general case, however -- which would be to detect / save / restore the current volume after doing whatever I wanted w/ it.

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

I assume you have considered:

SoundSetWaveVolume()

Yes, ty.

Point is to set it back exactly where it was, not some arbitrary number.

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

Does this work on your system?

Send("{VOLUME_MUTE}")

This indeed works properly on XP. Thanks for the addition to my toolset. Valuater's link to the appropriate DLL Call wrapper will be the basis for the solution of choice, as it covers the generic use case, and enables me to build a TrayTipSilent() UDF that properly restores volume at the end of the function. If I understand the applicable differences in win7, vista, xp and w2k correctly, this choice will also (where possible) change the volume for the affected process, not the entire session, whereas mute is a system-wide setting. Edited by flyingboz

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

This and many other GREAT additions to your script.... Autoit Wrappers

#133776

8)

@Valuater

Thanks, not only for this, but all you do for the AutoIT community. I have bookmarked the above UDF for later perusal, and now am at work building my TrayTipSilent() UDF, which suddenly got very easy :(

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

@Valuater

Thanks, not only for this, but all you do for the AutoIT community. I have bookmarked the above UDF for later perusal, and now am at work building my TrayTipSilent() UDF, which suddenly got very easy :(

Your welcome flyingboz!!!

... and thanks for the kudos!!

8)

NEWHeader1.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...