Microsoft SDK for Java

getPan

This method of the DirectSoundBuffer Class retrieves a variable that represents the relative volume between the left and right audio channels.

Syntax

public int getPan();

Return Value

Returns the relative mix between the left and right speakers.

Remarks

The returned value is measured in hundredths of a decibel (dB), in the range of -10,000 to 10,000. The value -10,000 means the right channel is attenuated by 100 dB. The value 10,000 means the left channel is attenuated by 100 dB. 0 is the neutral value; a return value of 0 means that both channels are at full volume (they are attenuated by 0 decibels). At any setting other than 0, one of the channels is at full volume and the other is attenuated.

A pan 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. A pan of -10,000 means that the right channel is silent and the sound is "all the way to the left," while a pan of 10,000 means that the left channel is silent and the sound is "all the way to the right."

The pan control acts cumulatively with the volume control.

See Also

getVolume, setPan, setVolume

© 1999 Microsoft Corporation. All rights reserved. Terms of use.