Search the Community
Showing results for tags 'Master Volume Control'.
-
Hello everyone! An user from the Brazilian AutoIt forum asked if it was possible to control the master volume of the sound, so I made this UDF, I hope you like it! Source: #include-once ; #INDEX# ======================================================================================================================= ; Title ...........: MasterVolume.au3 ; AutoIt Version ..: 3.2.3++ ; Language ........: English ; Description .....: Controls the Master volume. ; Author ..........: João Carlos (Jscript FROM Brazil) ; Collaboration....: ; Link ............: ; Modified by .....: ; =============================================================================================================================== ; #VARIABLES# =================================================================================================================== ;================================================================================================================================ ; #CURRENT# ===================================================================================================================== ; _MasterVolume_Down ; _MasterVolume_Up ; =============================================================================================================================== ; #INTERNAL_USE_ONLY#============================================================================================================ ;================================================================================================================================ ; #FUNCTION# ==================================================================================================================== ; Name ..........: _MasterVolume_Up ; Description ...: Sets the master volume to UP by percent. ; Syntax ........: _MasterVolume_Up([$iPercent = 5[, $lSmooth = False]]) ; Parameters ....: $iPercent - [optional] An integer value. Default is 5. ; $lSmooth - [optional] An unknown value. Default is False. ; Return values .: None ; Author ........: João Carlos (Jscript FROM Brazil) ; Modified ......: ; Remarks .......: Tested on Windows Vista/Seven ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _MasterVolume_Up($iPercent = 5, $lSmooth = False) For $i = 1 To $iPercent Send('{VOLUME_UP}') If $lSmooth Then Sleep(10) Next EndFunc ;==>_MasterVolume_Up ; #FUNCTION# ==================================================================================================================== ; Name ..........: _MasterVolume_Down ; Description ...: Sets the master volume to Down by percent. ; Syntax ........: _MasterVolume_Down([$iPercent = 5[, $lSmooth = False]]) ; Parameters ....: $iPercent - [optional] An integer value. Default is 5. ; $lSmooth - [optional] An unknown value. Default is False. ; Return values .: None ; Author ........: João Carlos (Jscript FROM Brazil) ; Modified ......: ; Remarks .......: Tested on Windows Vista/Seven ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _MasterVolume_Down($iPercent = 5, $lSmooth = False) For $i = 1 To $iPercent Send('{VOLUME_DOWN}') If $lSmooth Then Sleep(10) Next EndFunc ;==>_MasterVolume_Down Regards, João Carlos.