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

' 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

Related Functions

auxGetVolume

Category

Audio

Back to the index.


Last Modified: September 10, 1999
This page is copyright © 1999 Paul Kuliniewicz. Copyright Information

Go to Paul Kuliniewicz's Home Page.
E-mail: rogue953@hotmail.com
This page is at http://skyscraper.fortunecity.com/transmission/45/api/a/auxsetvolume.html