Microsoft DirectX 8.1 (Visual Basic)

DirectSoundSecondaryBuffer8.SetPan

The SetPan method specifies the relative volume between the left and right channels.

Syntax

object.SetPan(pan As Long)

Parts

object

Resolves to a DirectSoundSecondaryBuffer8 object.

pan

Value that specifies the relative attenuation of the channels. See Remarks.

Error Codes

If the method fails, an error is raised and Err.Number may be set to one of the following error values.

DSERR_CONTROLUNAVAIL
DSERR_GENERIC
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED

Remarks

The value in pan is in hundredths of a decibel (dB), in the range of DSBPAN_LEFT (-10,000) to DSBPAN_RIGHT (10,000). The value DSBPAN_LEFT means the right channel is attenuated by 100 dB. The value DSBPAN_RIGHT means the left channel is attenuated by 100 dB. The neutral value is DSBPAN_CENTER (0), meaning that both channels are at full volume (attenuated by 0 decibels).

At any setting other than DSBPAN_CENTER, one channel is at full volume and the other is attenuated. For example, a value of -2173 means that the left channel is at full volume and the right channel is attenuated by 21.73 dB. Similarly, a pan of 870 means that the left channel is attenuated by 8.7 dB and the right channel is at full volume.

The pan control acts cumulatively with the volume control.

See Also