Package com.sun.j3d.audioengines
Class Sample
java.lang.Object
com.sun.j3d.audioengines.Sample
The Sample class defines the data and methods associated with a sound
sample played through the AudioDevice.
This contains all the data fields for non-spatialized and spatialized
(positional and directional) sound samples.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double[]
Directional Sound's gain can be attenuated based on the listener's location off-angle from the source source direction.protected float[]
protected int
protected float[]
protected double[]
protected float[]
protected double[]
Pairs of distances and gain scale factors that define piecewise linear gain BACK attenuation between each pair.protected float[]
protected static final boolean
protected javax.vecmath.Vector3f
The Cone Sound's direction vector.protected int
dirty flags denoting what has changed since last renderingprotected long
static final int
protected float
Overall Scale Factor applied to sound gain.protected static final boolean
protected int
Number of times sound is looped/repeated during playstatic final int
protected boolean
static final int
Distance Filter Each sound source is attenuated by a filter based on it's distance from the listener.static final int
Null Sound identifier denotes sound is not created or initializedprotected int
protected float
protected int
protected float
protected float
protected int
protected float
protected javax.vecmath.Point3f
protected float
Overall Scale Factor applied to sound.protected MediaContainer
sound data associated with sound sourceprotected int
sound data associated with sound sourceprotected Transform3D
protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears/re-initialize fields associated with sample data for this sound, and frees any device specific data associated with this sample.protected void
debugPrint
(String message) protected void
debugPrintln
(String message) int
long
float
getGain()
int
boolean
int
float
float
float
int
long
boolean
void
render
(int dirtyFlags, View view, AuralParameters attribs) void
setAngularAttenuation
(int filterType, double[] angle, float[] attenuationScaleFactor, float[] filterCutoff) void
setDirection
(javax.vecmath.Vector3d direction) void
setDirtyFlags
(int flags) void
setDistanceGain
(double[] frontDistance, float[] frontAttenuationScaleFactor, double[] backDistance, float[] backAttenuationScaleFactor) void
setGain
(float scaleFactor) void
setLoopCount
(int count) void
setMuteFlag
(boolean flag) void
setObstructionFilter
(float cutoffFrequency) void
setObstructionGain
(float scaleFactor) void
setOcclusionFilter
(float cutoffFrequency) void
setOcclusionGain
(float scaleFactor) void
setPosition
(javax.vecmath.Point3d position) void
setRateScaleFactor
(float scaleFactor) void
void
setSoundType
(int type) void
setVWrldXfrmFlag
(boolean flag)
-
Field Details
-
debugFlag
protected static final boolean debugFlag- See Also:
-
internalErrors
protected static final boolean internalErrors- See Also:
-
NULL_SAMPLE
public static final int NULL_SAMPLENull Sound identifier denotes sound is not created or initialized- See Also:
-
soundData
sound data associated with sound source -
soundType
protected int soundTypesound data associated with sound source -
gain
protected float gainOverall Scale Factor applied to sound gain. -
rateScaleFactor
protected float rateScaleFactorOverall Scale Factor applied to sound.- Since:
- Java 3D 1.3
-
loopCount
protected int loopCountNumber of times sound is looped/repeated during play -
DURATION_UNKNOWN
public static final int DURATION_UNKNOWN- See Also:
-
duration
protected long duration -
numberOfChannels
protected int numberOfChannels -
mute
protected boolean mute -
vworldXfrm
-
vwXfrmFlag
protected boolean vwXfrmFlag -
position
protected javax.vecmath.Point3f position -
attenuationDistance
protected double[] attenuationDistance -
attenuationGain
protected float[] attenuationGain -
dirtyFlags
protected int dirtyFlagsdirty flags denoting what has changed since last rendering -
direction
protected javax.vecmath.Vector3f directionThe Cone Sound's direction vector. This is the cone axis. -
backAttenuationDistance
protected double[] backAttenuationDistancePairs of distances and gain scale factors that define piecewise linear gain BACK attenuation between each pair. These are used for defining elliptical attenuation regions. -
backAttenuationGain
protected float[] backAttenuationGain -
angularDistance
protected double[] angularDistanceDirectional Sound's gain can be attenuated based on the listener's location off-angle from the source source direction. This can be set by three parameters: angular distance in radians gain scale factor filtering (currently the only filtering supported is lowpass) -
angularGain
protected float[] angularGain -
NO_FILTERING
public static final int NO_FILTERINGDistance Filter Each sound source is attenuated by a filter based on it's distance from the listener. For now the only supported filterType will be LOW_PASS frequency cutoff. At some time full FIR filtering will be supported.- See Also:
-
LOW_PASS
public static final int LOW_PASS- See Also:
-
angularFilterType
protected int angularFilterType -
angularFilterCutoff
protected float[] angularFilterCutoff -
obstructionGain
protected float obstructionGain -
obstructionFilterType
protected int obstructionFilterType -
obstructionFilterCutoff
protected float obstructionFilterCutoff -
occlusionGain
protected float occlusionGain -
occlusionFilterType
protected int occlusionFilterType -
occlusionFilterCutoff
protected float occlusionFilterCutoff
-
-
Constructor Details
-
Sample
public Sample()
-
-
Method Details
-
debugPrint
-
debugPrintln
-
getDuration
public long getDuration() -
getStartTime
public long getStartTime() -
getNumberOfChannelsUsed
public int getNumberOfChannelsUsed() -
setDirtyFlags
public void setDirtyFlags(int flags) -
getDirtyFlags
public int getDirtyFlags() -
setSoundType
public void setSoundType(int type) -
getSoundType
public int getSoundType() -
setSoundData
-
getSoundData
-
setMuteFlag
public void setMuteFlag(boolean flag) -
getMuteFlag
public boolean getMuteFlag() -
setVWrldXfrmFlag
public void setVWrldXfrmFlag(boolean flag) -
getVWrldXfrmFlag
public boolean getVWrldXfrmFlag() -
setGain
public void setGain(float scaleFactor) -
getGain
public float getGain() -
setLoopCount
public void setLoopCount(int count) -
getLoopCount
public int getLoopCount() -
setPosition
public void setPosition(javax.vecmath.Point3d position) -
setDistanceGain
public void setDistanceGain(double[] frontDistance, float[] frontAttenuationScaleFactor, double[] backDistance, float[] backAttenuationScaleFactor) -
setDirection
public void setDirection(javax.vecmath.Vector3d direction) -
setAngularAttenuation
public void setAngularAttenuation(int filterType, double[] angle, float[] attenuationScaleFactor, float[] filterCutoff) -
setRateScaleFactor
public void setRateScaleFactor(float scaleFactor) -
getRateScaleFactor
public float getRateScaleFactor() -
setObstructionGain
public void setObstructionGain(float scaleFactor) -
getObstructionGain
public float getObstructionGain() -
setObstructionFilter
public void setObstructionFilter(float cutoffFrequency) -
setOcclusionGain
public void setOcclusionGain(float scaleFactor) -
getOcclusionGain
public float getOcclusionGain() -
setOcclusionFilter
public void setOcclusionFilter(float cutoffFrequency) -
clear
public void clear()Clears/re-initialize fields associated with sample data for this sound, and frees any device specific data associated with this sample. -
render
-