Jump to content

_MasterVolume.au3 (UDF) - Controls the master volume


JScript
 Share

Recommended Posts

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.

Edited by jscript

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

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