Sound Volume SDK ActiveX

Sound Volume SDK ActiveX 3.1

Platform : Windows 9X, XP, Vista, Window 7

For Windows Developers who need to control sound volume in vb.net, c++, c#, vb, delphi, vfp, access.

How to use vb script to adjust speaker volume in Window 7, Vista

Step 1: Download trial version of Sound Volume ActiveX and installed it.

Step 2: Create text file and add following code and save to test.vbs

Set obj=CreateObject("SOUNDVOLUME.SoundVolumeCtrl.1")

if obj.IsVistaWindows7 then
    
    obj.W7SetCurrentDevice obj.W7GetSpeakersName(0)
    obj.W7SetDeviceVolume 0
        MsgBox "set the master volume of first speaker " obj.W7GetSpeakersName(0) " to 0"

End If

Step 3: double click test.vbs, It will set the first speaker volume to 0. Some system have two speakers, so you need select correct speaker , the following code select second speaker.
    obj.W7SetCurrentDevice obj.W7GetSpeakersName(1)