Jump to content
Sign in to follow this  
KaFu

SoundSetWaveVolume() for current script only?

Recommended Posts

KaFu

HiHo,

the Help-File tells about SoundSetWaveVolume():

"On Windows Vista, there is no system-wide wave volume. This function only changes the wave volume for the script. It can not be used to change the wave volume of other programs."

Thats exactly what I'm looking for, but it should work for XP too. I saw solutions in the forum to change setting in runtime or to tweak registry keys, but what I'm looking for is a global possibility to enforce this behavior on XP too (API Call?). Anyone got a hint for me?

Best Regards

Share this post


Link to post
Share on other sites
Phantomasss

How to set a volume for "SoundPlay" only?

"SoundSetWaveVolume" set volume in all system... this bad.

Thanks...

Share this post


Link to post
Share on other sites
KaFu

Nope, thanks for the reply. Here's a sample of what I searched for, only that I don't want to set the wave volume globally to 0 but just for my GUI.

#include <GUIConstantsEx.au3>
Local $Button_1, $Button_2, $msg
GUICreate("My GUI Button") ; will create a dialog box that when displayed is centered

Opt("GUICoordMode", 2)
$Button_1 = GUICtrlCreateButton("Button 1", 10, 30, 100)
$Button_2 = GUICtrlCreateButton("Button 2", 0, -1)

GUISetState() ; will display an  dialog box with 2 button

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button_1
            SoundSetWaveVolume(0)
            MsgBox(0, 'Testing', 'Button 1 was pressed' & @CRLF & '...silence...') ; Will demonstrate Button 2 being pressed
            SoundSetWaveVolume(100)
        Case $msg = $Button_2
            MsgBox(0, 'Testing', 'Button 2 was pressed' & @CRLF & '...DONG...') ; Will demonstrate Button 2 being pressed
    EndSelect
WEnd

Share this post


Link to post
Share on other sites
LoWang

I am sorry but I don't really understand you. It is exactly the opposite! :) I use this function in windows XP and it works - globally sets the wave mixer which affects all system sounds and applications. On the other hand it does not work in Vista at all. Is there a way of changing sound volume in vista? Either globally or for a specific application or window at least. Thanks

Share this post


Link to post
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
Sign in to follow this  

×