|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DistanceAttenuationControl
DistanceAttenuationControl
is an interface for controlling how
the sound from a sound source is attenuated with its distance from the Spectator
. If the
control is supported, it can be retrieved from a SoundSource3D
.
As the distance R of a sound source from the listener increases, its Distance Gain decreases accordingly, to model the reality that sounds which are further away tend to sound quieter than sounds that are nearby. The formula for Distance Gain is as follows:
where: R is the distance of the sound source from the listener,Rmin is the minimum distance, below which the distance gain is clipped to its maximum value of 1.0,Rmax is the maximum distance, beyond which the distance gain is clipped as follows:muteAfterMax is false implies that the distance gain for values of R= Rmax remains constant at its value for R = Rmax,muteAfterMax is true implies that the distance gain is clipped to zero for values of R= Rmax, andRolloffFactor is an exponent controlling the rate at which the distance gain attenuates with distance.
All of these values are set simultaneously, as arguments to the
Method Summary | ||
---|---|---|
int |
getMaxDistance()
|
|
int |
getMinDistance()
|
|
boolean |
getMuteAfterMax()
|
|
int |
getRolloffFactor()
|
|
void |
setParameters(int minDistance,
int maxDistance,
boolean muteAfterMax,
int rolloffFactor)
Sets all the 3D audio distance attenuation parameters simultaneously. |
Method Detail |
---|
void setParameters(int minDistance, int maxDistance, boolean muteAfterMax, int rolloffFactor)
Distances are specified in millimeters.
minDistance
- the minimum distance, below which the distance
gain is clipped to its maximum value of 1.0maxDistance
- the maximum distance, beyond which the distance gain does not decrease any
more. The exact behaviour of the gain at distances beyond the maximum distance
depends on the value of the muteAfterMax
.muteAfterMax
- a boolean determining how the distance gain behaves at distances greater
than maxDistance
:
true
if beyond the maximum distance the source is silent;
false
if beyond the maximum distance the source's gain is held constant at the
level at the maximum distance.rolloffFactor
- the rolloff factor, specified in thousandths
(1000
representing a rolloff factor of 1.0, 2000
representing 2.0
and 500
representing 0.5). Higher values cause the distance gain to attenuate
more quickly.
IllegalArgumentException
- if maxDistance = minDistance
,
minDistance = 0
, maxDistance = 0
or
rolloffFactor 0
int getMinDistance()
the minimum distance in millimeters
int getMaxDistance()
muteAfterMax
.
the maximum distance in millimeters
boolean getMuteAfterMax()
true if beyond the maximum distance the source is silent, or false if beyond the maximum distance the source's gain is held constant at the level at the maximum distance
int getRolloffFactor()
the rolloff factor as an exponent specified in thousandths
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal