computer audio level

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sbrady19
Posts: 338
Joined: 12 Apr 2018, 05:22
Location: Central Florida
Contact:

computer audio level

22 May 2018, 10:19

I have a slider to control the master audio output level on my GUI.
The GUI sets the computer volume to 0 at startup without me touching the slider
how can I set the computer volume to 100 at startup
here is code I got on this forum.

Code: Select all

Gui, Add, Slider, x40 y210 w100 h80 Center Thick20 Range0-100 ToolTip vPoS AltSubmit gVol,% Volume


Vol:
Gui,Submit,NoHide
SoundSet,% PoS
GuiControl,,TEST,% "Computer Vol " Var:=PoS



;;;;;;;;;;;;;;;slider for volume
buttonslider:
GuiControlGet, msctls_trackbar321
soundset, msctls_trackbar321
return
;;;;;;;;;;;;;;;end slider for volume


AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

Re: computer audio level

22 May 2018, 11:18

add the number at the end of the first line like this

Gui, Add, Slider, x40 y210 w100 h80 Center Thick20 Range0-100 ToolTip vPoS AltSubmit gVol,% Volume 20

it will start at 20
garry
Posts: 3777
Joined: 22 Dec 2013, 12:50

Re: computer audio level

22 May 2018, 12:45

also a volume example

Code: Select all

;run,sndvol32.exe  ; -XP
run,sndvol.exe
CB=runDLL32.EXE shell32.dll,Control_RunDLL mmsys.cpl,,0
run,%CB%

Gui,2:default
;Gui,2: Color, ControlColor,Black           ;- background from edit
Gui,2: Color, Gray                                ;- Gui color
Gui,2: -DPIScale
Gui,2:Font, CDefault , FixedSys

sm1:=30                                 ;- set volume
soundset,0,master,mute         ;- SPEAKER=MASTER ON
SoundSet,%sm1%,master         ;- SPEAKER=MASTER volume

Gui,2:add, text    , cYellow vT1 w25 right,%sm1%
Gui,2:Add, Slider  , x30  y40  h47  w550     altsubmit    vVOL11a gVOL11 Range0-100 left thick37 line10 Tickinterval10,%sm1%

;------------------------------------------------
Gui,2:show,x10 y10 h130 w600 ,Volume-Master
return

2Guiclose:
exitapp

;----- volumex ----------
VOL11:
GuiControlGet, VOL11a
Guicontrol,2:,T1,%VOL11a%
SoundSet,%vol11a%,master
return
;------------------------

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: gongnl, mikeyww, Tvlao and 163 guests