All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.media.j3d.PointSound

java.lang.Object
   |
   +----java.media.j3d.SceneGraphObject
           |
           +----java.media.j3d.Node
                   |
                   +----java.media.j3d.Leaf
                           |
                           +----java.media.j3d.Sound
                                   |
                                   +----java.media.j3d.PointSound

public class PointSound
extends Sound
The PointSound node (a sub-class of the Sound node) defines a spatially- located sound source whose waves radiate uniformly in all directions from a given location in space.


Variable Index

 o ALLOW_DISTANCE_GAIN_READ
Specifies that this node allows access to its object's distance gain attenuation information.
 o ALLOW_DISTANCE_GAIN_WRITE
Specifies that this node allows writing to its object's distance gain attenuation information.
 o ALLOW_POSITION_READ
Specifies that this node allows access to its object's position information.
 o ALLOW_POSITION_WRITE
Specifies that this node allows writing to its object's position information.

Constructor Index

 o PointSound()
Constructs a new Sound node using default parameters
 o PointSound(MediaContainer, float, float, float, float)
Constructs and initializes a new Point Sound node using specified parameters
 o PointSound(MediaContainer, float, int, boolean, boolean, boolean, Bounds, float, float, float, float[], float[])
Constructs and initializes a new Point Sound node using specified parameters
 o PointSound(MediaContainer, float, int, boolean, boolean, boolean, Bounds, float, float, float, Point2f[])
Constructs and initializes a new Point Sound node using specified parameters
 o PointSound(MediaContainer, float, int, boolean, boolean, boolean, Bounds, Point3f, float[], float[])
Constructs and initializes a new Point Sound node using specified parameters
 o PointSound(MediaContainer, float, int, boolean, boolean, boolean, Bounds, Point3f, Point2f[])
Constructs and initializes a new Point Sound node using specified parameters
 o PointSound(MediaContainer, float, Point3f)
Constructs and initializes a new Point Sound node using specified parameters

Method Index

 o getDistanceGain(float[], float[])
Gets this sound's distance gain attenuation values in separate arrays
 o getDistanceGain(Point2f[])
Gets this sound's distance attenuation
 o getPosition(Point3f)
Retrieves this sound's direction and places it in the vector provided.
 o setDistanceGain(float[], float[])
Sets this sound's distance gain attenuation as an array of Point2fs.
 o setDistanceGain(Point2f[])
Sets this sound's distance gain attenuation - where gain scale factor is applied to sound based on distance listener is from sound source.
 o setEnable(boolean)
Enable or disable sound.
 o setPosition(float, float, float)
Sets this sound's position from the three values provided.
 o setPosition(Point3f)
Sets this sound's location from the vector provided.
 o setSoundData(MediaContainer)
Sats fields that define the sound source data of this node.

Variables

 o ALLOW_POSITION_READ
 public static final int ALLOW_POSITION_READ
Specifies that this node allows access to its object's position information.

 o ALLOW_POSITION_WRITE
 public static final int ALLOW_POSITION_WRITE
Specifies that this node allows writing to its object's position information.

 o ALLOW_DISTANCE_GAIN_READ
 public static final int ALLOW_DISTANCE_GAIN_READ
Specifies that this node allows access to its object's distance gain attenuation information.

 o ALLOW_DISTANCE_GAIN_WRITE
 public static final int ALLOW_DISTANCE_GAIN_WRITE
Specifies that this node allows writing to its object's distance gain attenuation information.

Constructors

 o PointSound
 public PointSound()
Constructs a new Sound node using default parameters

 o PointSound
 public PointSound(MediaContainer soundData,
                   float initialGain,
                   Point3f position)
Constructs and initializes a new Point Sound node using specified parameters

Parameters:
soundData - sound data associated with this sound source node
initialGain - amplitude scale factor applied to sound source
position - 3D location of source
 o PointSound
 public PointSound(MediaContainer soundData,
                   float initialGain,
                   float posX,
                   float posY,
                   float posZ)
Constructs and initializes a new Point Sound node using specified parameters

Parameters:
soundData - sound data associated with this sound source node
initialGain - amplitude scale factor applied to sound source data
posX - x coordinate of location of source
posY - y coordinate of location of source
posZ - z coordinate of location of source
 o PointSound
 public PointSound(MediaContainer soundData,
                   float initialGain,
                   int loopCount,
                   boolean release,
                   boolean continuous,
                   boolean enable,
                   Bounds region,
                   Point3f position,
                   Point2f distanceGain[])
Constructs and initializes a new Point Sound node using specified parameters

Parameters:
soundData - sound data associated with this sound source node
initialGain - amplitude scale factor applied to sound source
loopCount - number of times loop is looped
release - flag denoting playing sound data to end
continuous - denotes that sound silently plays when disabled
enable - sound switched on/off
region - activation bounds
position - 3D location of source
distanceGain - array of (distance,gain) pairs controling attenuation
 o PointSound
 public PointSound(MediaContainer soundData,
                   float initialGain,
                   int loopCount,
                   boolean release,
                   boolean continuous,
                   boolean enable,
                   Bounds region,
                   float posX,
                   float posY,
                   float posZ,
                   Point2f distanceGain[])
Constructs and initializes a new Point Sound node using specified parameters

Parameters:
soundData - sound data associated with this sound source node
initialGain - amplitude scale factor applied to sound source
loopCount - number of times loop is looped
release - flag denoting playing sound to end
continuous - denotes that sound silently plays when disabled
enable - sound switched on/off
region - activation bounds
posX - x coordinate of location of source
posY - y coordinate of location of source
posZ - z coordinate of location of source
distanceGain - array of (distance,gain) pairs controling attenuation
 o PointSound
 public PointSound(MediaContainer soundData,
                   float initialGain,
                   int loopCount,
                   boolean release,
                   boolean continuous,
                   boolean enable,
                   Bounds region,
                   Point3f position,
                   float attenuationDistance[],
                   float attenuationGain[])
Constructs and initializes a new Point Sound node using specified parameters

Parameters:
soundData - sound data associated with this sound source node
initialGain - amplitude scale factor applied to sound source
loopCount - number of times loop is looped
release - flag denoting playing sound data to end
continuous - denotes that sound silently plays when disabled
enable - sound switched on/off
region - activation bounds
position - 3D location of source
attenuationDistance - array of distance values used for attenuation
attenuationGain - array of gain scale factors used for attenuation
 o PointSound
 public PointSound(MediaContainer soundData,
                   float initialGain,
                   int loopCount,
                   boolean release,
                   boolean continuous,
                   boolean enable,
                   Bounds region,
                   float posX,
                   float posY,
                   float posZ,
                   float attenuationDistance[],
                   float attenuationGain[])
Constructs and initializes a new Point Sound node using specified parameters

Parameters:
soundData - sound data associated with this sound source node
initialGain - amplitude scale factor applied to sound source
loopCount - number of times loop is looped
release - flag denoting playing sound to end
continuous - denotes that sound silently plays when disabled
enable - sound switched on/off
region - activation bounds
posX - x coordinate of location of source
posY - y coordinate of location of source
posZ - z coordinate of location of source
attenuationDistance - array of distance values used for attenuation
attenuationGain - array of gain scale factors used for attenuation

Methods

 o setPosition
 public final void setPosition(Point3f position)
Sets this sound's location from the vector provided.

Parameters:
position - the new location
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setPosition
 public final void setPosition(float x,
                               float y,
                               float z)
Sets this sound's position from the three values provided.

Parameters:
x - the new x position
y - the new y position
z - the new z position
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getPosition
 public final void getPosition(Point3f position)
Retrieves this sound's direction and places it in the vector provided.

Parameters:
position - the variable to receive the direction vector
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setDistanceGain
 public final void setDistanceGain(Point2f attenuation[])
Sets this sound's distance gain attenuation - where gain scale factor is applied to sound based on distance listener is from sound source.

Parameters:
attenuation - defined by pairs of (distance,gain-scale-factor)
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setDistanceGain
 public final void setDistanceGain(float distance[],
                                   float gain[])
Sets this sound's distance gain attenuation as an array of Point2fs.

Parameters:
distance - array of monotonically-increasing floats
gain - array of non-negative scale factors
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getDistanceGain
 public final void getDistanceGain(Point2f attenuation[])
Gets this sound's distance attenuation

Parameters:
attenuation - arrays containing distance attenuation pairs
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getDistanceGain
 public final void getDistanceGain(float distance[],
                                   float gain[])
Gets this sound's distance gain attenuation values in separate arrays

Parameters:
distance - array of float distance from sound source
gain - array of non-negative scale factors associated with
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setSoundData
 public final void setSoundData(MediaContainer soundData)
Sats fields that define the sound source data of this node. This differs from the Sound node method, in that it calls the PointSoundRetained version of this method.

Parameters:
soundData - description of JMF source data used by this sound source
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
Overrides:
setSoundData in class Sound
 o setEnable
 public void setEnable(boolean state)
Enable or disable sound. This differs from the Sound node method, in that it calls the PointSoundRetained version of this method.

Parameters:
state - enable (on/off) flag denotes if active sound is heard
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
Overrides:
setEnable in class Sound

All Packages  Class Hierarchy  This Package  Previous  Next  Index