# SoundSetWaveVolume

Changes the wave output volume for a sound device.

    SoundSetWaveVolume, Percent [, DeviceNumber]

### Parameters

Percent | Percentage number between -100 and 100 inclusive (it can be a floating point number or an expression). If the number begins with a plus or minus sign, the current volume level will be adjusted up or down by the indicated amount. Otherwise, the volume will be set explicitly to the level indicated by Percent.
DeviceNumber | If this parameter is omitted, it defaults to 1 (the first sound device), which is usually the system's default device for recording and playback. Specify a number higher than 1 to operate upon a different sound device.

### ErrorLevel

[v1.1.04+] This command is able to throw an exception on failure. For more information, see Runtime Errors.

ErrorLevel is set to 1 if there was a problem or 0 otherwise.

### Remarks

SoundSetWaveVolume has no effect on Windows Vista and later unless AutoHotkey.exe is running in XP-compatibility mode (this may be resolved in a future version). One way to change the master volume for the entire system is the following:

    Send {Volume_Up}  ; Raise the master volume by 1 interval (typically 5%).
    Send {Volume_Down 3}  ; Lower the master volume by 3 intervals.
    Send {Volume_Mute}  ; Mute/unmute the master volume.

The current wave output volume level can be retrieved via SoundGetWaveVolume. Settings such as Master Volume, Synth, Microphone, Mute, Treble, and Bass can be set and retrieved using SoundSet and SoundGet.

Unlike SoundSet, this command attempts to preserve the existing balance between channels (e.g. left and right) when changing the volume level.

### Related

SoundGetWaveVolume, SoundSet, SoundGet, SoundPlay

### Examples

    SoundSetWaveVolume, 50  ; Set the volume to its half-way point.
    SoundSetWaveVolume, -10  ; Decrease the current  level by 10 (e.g. 80 would become 70).
    SoundSetWaveVolume, +20  ; Increase the current level by 20.