com.sun.j3d.audioengines
Class Sample

java.lang.Object
  |
  +--com.sun.j3d.audioengines.Sample
Direct Known Subclasses:
JSSample

public class Sample
extends java.lang.Object

The Sample Class defines the data and methods associated with a sound sample played thru the AudioDevice. This contains all the data fields for non-spatialized and spatialized (positional and directional) sound samples.


Field Summary
protected  double[] angularDistance
          Directional Sound's gain can be attenuated based on the listener's location off-angle from the source source direction.
protected  float[] angularFilterCutoff
           
protected  int angularFilterType
           
protected  float[] angularGain
           
protected  double[] attenuationDistance
           
protected  float[] attenuationGain
           
protected  double[] backAttenuationDistance
          Pairs of distances and gain scale factors that define piecewise linear gain BACK attenuation between each pair.
protected  float[] backAttenuationGain
           
protected static boolean debugFlag
          Debug print mechanism for Sound nodes
protected  Vector3f direction
          The Cone Sound's direction vector.
protected  int dirtyFlags
          dirty flags denoting what has changed since last rendering
protected  long duration
           
protected  float gain
          Overall Scale Factor applied to sound.
protected static boolean internalErrors
           
protected  int loopCount
          Number of times sound is looped/repeated during play
protected static int LOW_PASS
           
protected  boolean mute
           
protected static int NO_FILTERING
          Distance Filter Each sound source is attenuated by a filter based on it's distance from the listener.
protected static int NULL_SAMPLE
          Null Sound identifier denotes sound is not created or initialized
protected  int numberOfChannels
           
protected  Point3f position
           
protected  MediaContainer soundData
          sound data associated with sound source
protected  int soundType
          sound data associated with sound source
protected  Transform3D vworldXfrm
           
protected  boolean vwXfrmFlag
           
 
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.
protected  void debugPrint(java.lang.String message)
           
protected  void debugPrintln(java.lang.String message)
           
 int getDirtyFlags()
           
 long getDuration()
           
 int getLoopCount()
           
 boolean getMuteFlag()
           
 int getNumberOfChannelsUsed()
           
 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 setPosition(Point3d position)
           
 void setSoundData(MediaContainer ref)
           
 void setSoundType(int type)
           
 void setVWrldXfrmFlag(boolean flag)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugFlag

protected static final boolean debugFlag
Debug print mechanism for Sound nodes

internalErrors

protected static final boolean internalErrors

NULL_SAMPLE

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

soundData

protected MediaContainer soundData
sound data associated with sound source

soundType

protected int soundType
sound data associated with sound source

gain

protected float gain
Overall Scale Factor applied to sound.

loopCount

protected int loopCount
Number of times sound is looped/repeated during play

duration

protected long duration

numberOfChannels

protected int numberOfChannels

mute

protected boolean mute

vworldXfrm

protected Transform3D vworldXfrm

vwXfrmFlag

protected boolean vwXfrmFlag

position

protected Point3f position

attenuationDistance

protected double[] attenuationDistance

attenuationGain

protected float[] attenuationGain

dirtyFlags

protected int dirtyFlags
dirty flags denoting what has changed since last rendering

direction

protected Vector3f direction
The Cone Sound's direction vector. This is the cone axis.

backAttenuationDistance

protected double[] backAttenuationDistance
Pairs 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[] angularDistance
Directional 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

protected 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.

LOW_PASS

protected static final int LOW_PASS

angularFilterType

protected int angularFilterType

angularFilterCutoff

protected float[] angularFilterCutoff
Constructor Detail

Sample

public Sample()
Method Detail

debugPrint

protected void debugPrint(java.lang.String message)

debugPrintln

protected void debugPrintln(java.lang.String message)

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)

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)

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)

stop

public void stop()