auxSetVolume Function

Declare Function auxSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByVal dwVolume As Long) As Long

Platforms

Description & Usage

auxSetVolume sets the current volume of an auxiliary audio device. This function works whether the device supports separate left and right channel volumes or not.

Return Value

If an error occured, the function returns a non-zero error code. If successful, the function returns 0.

Visual Basic-Specific Issues

None.

Parameters

uDeviceID
The device ID of the auxiliary audio device to set the volume of. Valid values range from zero to the number of auxiliary audio devices minus one.
dwVolume
The new volume setting of the device. If the device supports separate left and right channel volumes, the low-order word contains the left channel volume and the high-order word contains the right channel volume. If the device supports only one overall volume, the low-order word is the volume. Valid volumes range from &H0 to &HFFFF.

Example

' This code is licensed according to the terms and conditions listed here.

' Set the volume of auxiliary audio device 0 to 50%.  Here,
' we don't care whether the device supports separate volumes or
' not, since the code works either way.
Dim retval As Long  ' return value

' Set the volume of both channels (if a second exists) to 50% (&H8000).
retval = auxSetVolume(0, &H80008000)  ' both words are set

See Also

auxGetVolume

Category

Audio

Go back to the alphabetical Function listing.
Go back to the Reference section index.


Last Modified: September 10, 1999
This page is copyright © 1999 Paul Kuliniewicz. Copyright Information Revised October 29, 2000
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/a/auxsetvolume.html