Sign in to follow this  
Followers 0
thepip3r

Manipulating sound on a system...

4 posts in this topic

I'm not looking for code. I just want to know if anyone can point me in the right direction (say to a UDF or previous forum post) concerning how a script can manipulate the system sound volume? I've done general search on the forums for "sound", "sound udf", "volume manipulation", etc and haven't found anything relative to what I'm looking for. I'd appreciate any guidance.


My Additions:- RunAs AdminDeviant Fun:- Variable Sound Volume

Share this post


Link to post
Share on other sites



I'm not looking for code. I just want to know if anyone can point me in the right direction (say to a UDF or previous forum post) concerning how a script can manipulate the system sound volume? I've done general search on the forums for "sound", "sound udf", "volume manipulation", etc and haven't found anything relative to what I'm looking for. I'd appreciate any guidance.

Took me a while to remember who I had remembered talking about this stuff. Here is one from Volly that may help.


- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Awesome --

FYI -- I hope this doesn't break any kind of TOS about pulling a prank on a coworker but he listens to his music WAY TOO LOUD. So I'm going to throw this in this startup folder on his profile so when he's listneing to music, it will adjust the volume by 5% every 15 secs just to throw him off. =P

#include <Audio.au3>
#NoTrayIcon

Global $x,$state

$state = "inc"

For $x=0 to 3000; Approx a half day based off of the sleep value
    
    _VariantVolLevel()
    Sleep(15000); Sleep 15 Seconds

Next



Func _VariantVolLevel()
    Local $curVolume

    
    $curVolume = Int(_SoundGetMasterVolume())
    
    Select
        Case $curVolume <= 0
            _SoundSetMasterVolume(1)
            $state = "inc"
        Case $curVolume >= 100
            _SoundSetMasterVolume(99)
            $state = "dec"
        Case $curVolume>=0 AND $curVolume<=100
            If $state="inc" Then
                $curVolume += 5
            ElseIf $state = "dec" Then
                $curVolume -= 5
            EndIf
            
            _SoundSetMasterVolume($curVolume)
    EndSelect
        
;MsgBox(0,$x,"Current: " & _SoundGetMasterVolume() & @CRLF & "State: " & $state  & @CRLF & "Val: " & $curVolume)
        
EndFunc

If this is not cool to post, please let me know.

Thanx for the help gentlemen, those UDFs are exactly what I was looking for.

Edited by thepip3r

My Additions:- RunAs AdminDeviant Fun:- Variable Sound Volume

Share this post


Link to post
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
Sign in to follow this  
Followers 0