Jump to content

Controlling the Master Volume


Recommended Posts

Well few questions here:

How would I grab the data of the current % of the master volume?

I know you can change the volume of this

SoundPlay(@ScripDir & "/Song.mp3")

But how do you change the master volume in all on going programs?

on Windows XP it's SetSound, on Vista it's a dll call job, and on WIndows 7, it fails.

I have a radio app, works fine on all but 7 even with DLLCall.

EDIT: Adding link.

Edited by TomDuDolan

My ickle pieces of software :3Radio Scriptr //Almost completeSimple IP/URL pinger, my first program. //CompletedSimple Downloader // Working - basic stateOn-GoingRadio Scriptr - Radio Server.

Link to comment
Share on other sites

on Windows XP it's SetSound, on Vista it's a dll call job, and on WIndows 7, it fails.

I have a radio app, works fine on all but 7 even with DLLCall.

EDIT: Adding link.

you cant be serious... all the systems I have are 7

well the Send("{Volume_UP}") works so it's just a matter of getting the value right?

Link to comment
Share on other sites

you cant be serious... all the systems I have are 7

well the Send("{Volume_UP}") works so it's just a matter of getting the value right?

Yeah I guess so, but are your volumes actually changing?

If so, could you try my radio app and report back? 5 people on windows 7 is having issues.

-T

My ickle pieces of software :3Radio Scriptr //Almost completeSimple IP/URL pinger, my first program. //CompletedSimple Downloader // Working - basic stateOn-GoingRadio Scriptr - Radio Server.

Link to comment
Share on other sites

Hmm, what's the line you're using for your volume? Is it based on Hotkeys?

If you could be kind enough, could you PM me your volume code, if it's working on 7?

Credits will be given.

-T

My ickle pieces of software :3Radio Scriptr //Almost completeSimple IP/URL pinger, my first program. //CompletedSimple Downloader // Working - basic stateOn-GoingRadio Scriptr - Radio Server.

Link to comment
Share on other sites

Hmm, what's the line you're using for your volume? Is it based on Hotkeys?

If you could be kind enough, could you PM me your volume code, if it's working on 7?

Credits will be given.

-T

Sure, anything to help the community!

#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <WindowsConstants.au3>

$s = 0
Do
    Send("{Volume_down}")
    $s += 1
Until $s = 99 ;as you can see since I couldn't grab the volume variable I made it something I would know.
$s2 = 0 ;I don't use this idk why I have it
$v = 0

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Volume Kon", 152, 48, 192, 114)
$Slider1 = GUICtrlCreateSlider(0, 0, 150, 45)
GUICtrlSetLimit($Slider1, 100, 0)
GUICtrlSetData($Slider1, 0)
$hSlider = GUICtrlGetHandle($Slider1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

GUIRegisterMsg($WM_HSCROLL,"hscroll") ;for instant volume control

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func hscroll($hWnd, $iMsg, $iwParam, $ilParam)
    If $ilParam = $hSlider Then
        $sr = GUICtrlRead($Slider1)
        If $sr > $v Then ;and now I play the matching game...
            Do
                $v += 1
                Send("{Volume_up}")
            Until $v = $sr
        ElseIf $sr < $v Then
            Do
                $v -= 1
                Send("{Volume_down}")
            Until $v = $sr
        EndIf
    EndIf
    Return "GUI_RUNDEFMSG"
EndFunc
Edited by Klovis
Link to comment
Share on other sites

Sure, anything to help the community!

#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <WindowsConstants.au3>

$s = 0
Do
    Send("{Volume_down}")
    $s += 1
Until $s = 99 ;as you can see since I couldn't grab the volume variable I made it something I would know.
$s2 = 0 ;I don't use this idk why I have it
$v = 0

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Volume Kon", 152, 48, 192, 114)
$Slider1 = GUICtrlCreateSlider(0, 0, 150, 45)
GUICtrlSetLimit($Slider1, 100, 0)
GUICtrlSetData($Slider1, 0)
$hSlider = GUICtrlGetHandle($Slider1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

GUIRegisterMsg($WM_HSCROLL,"hscroll") ;for instant volume control

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func hscroll($hWnd, $iMsg, $iwParam, $ilParam)
    If $ilParam = $hSlider Then
        $sr = GUICtrlRead($Slider1)
        If $sr > $v Then ;and now I play the matching game...
            Do
                $v += 1
                Send("{Volume_up}")
            Until $v = $sr
        ElseIf $sr < $v Then
            Do
                $v -= 1
                Send("{Volume_down}")
            Until $v = $sr
        EndIf
    EndIf
    Return "GUI_RUNDEFMSG"
EndFunc

Thanks, will have it integrated soon, will give you credits in the source and in the 'about' box.

Cheers.

-T

EDIT:

Working like a charm on Win XP, Vista and 7 now! Thanks!

Edited by TomDuDolan

My ickle pieces of software :3Radio Scriptr //Almost completeSimple IP/URL pinger, my first program. //CompletedSimple Downloader // Working - basic stateOn-GoingRadio Scriptr - Radio Server.

Link to comment
Share on other sites

Thanks, will have it integrated soon, will give you credits in the source and in the 'about' box.

Cheers.

-T

EDIT:

Working like a charm on Win XP, Vista and 7 now! Thanks!

You're welcome. I can't believe I answered my own question in the forum...

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...