JScript Posted January 11, 2012 Share Posted January 11, 2012 (edited) 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:expandcollapse popup#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. Edited January 11, 2012 by jscript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now