com.sun.j3d.audioengines
Class Sample

java.lang.Object
  extended by com.sun.j3d.audioengines.Sample

public class Sample
extends java.lang.Object

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
static int DURATION_UNKNOWN
           
static int LOW_PASS
           
static int NO_FILTERING
          Distance Filter Each sound source is attenuated by a filter based on it's distance from the listener.
static int NULL_SAMPLE
          Null Sound identifier denotes sound is not created or initialized
 
Constructor Summary
Sample()
           
 
Method Summary
 void clear()
          Clears/re-initialize fields associated with sample data for this sound, and frees any device specific data associated with this sample.
 int getDirtyFlags()
           
 long getDuration()
           
 float getGain()
           
 int getLoopCount()
           
 boolean getMuteFlag()
           
 int getNumberOfChannelsUsed()
           
 float getObstructionGain()
           
 float getOcclusionGain()
           
 float getRateScaleFactor()
           
 MediaContainer getSoundData()
           
 int getSoundType()
           
 long getStartTime()
           
 boolean getVWrldXfrmFlag()
           
 void render(int dirtyFlags, View view, AuralParameters attribs)
           
 void setAngularAttenuation(int filterType, double[] angle, float[] attenuationScaleFactor, float[] filterCutoff)
           
 void setDirection(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(Point3d position)
           
 void setRateScaleFactor(float scaleFactor)
           
 void setSoundData(MediaContainer ref)
           
 void setSoundType(int type)
           
 void setVWrldXfrmFlag(boolean flag)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_SAMPLE

public static final int NULL_SAMPLE
Null Sound identifier denotes sound is not created or initialized

See Also:
Constant Field Values

DURATION_UNKNOWN

public static final int DURATION_UNKNOWN
See Also:
Constant Field Values

NO_FILTERING

public static final int NO_FILTERING
Distance 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:
Constant Field Values

LOW_PASS

public static final int LOW_PASS
See Also:
Constant Field Values
Constructor Detail

Sample

public Sample()
Method Detail

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

public void setSoundData(MediaContainer ref)

getSoundData

public MediaContainer 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(Point3d position)

setDistanceGain

public void setDistanceGain(double[] frontDistance,
                            float[] frontAttenuationScaleFactor,
                            double[] backDistance,
                            float[] backAttenuationScaleFactor)

setDirection

public void setDirection(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

public void render(int dirtyFlags,
                   View view,
                   AuralParameters attribs)