All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javax.media.j3d.Sound

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

public abstract class Sound
extends Leaf
Sound node is an abstract class that defines the properties common to all sound sources. A scene graph can contain multiple sounds. Associated with each sound source are: a reference to sound data, an amplitude scale factor, a release flag denoting that the sound associated with this node is to play to end when it is disabled, the number of times sound is to be repeated, the sound's state (on or off), a scheduling region, and flag denoting if the sound is to continue playing "silently" even while it is inactive. Whenever the listener is within a sound node's scheduling bounds this sound is potentially audible.

Sound Data

Initial Gain

Loop

Release Flag

Continuous Flag

Enable Sound

Scheduling Bounds

Scheduling Bounding Leaf

Prioritize Sound

Duration

Playing Status


Variable Index

 o ALLOW_CONT_PLAY_READ
Specifies that this node allows access to its object's continuous play information.
 o ALLOW_CONT_PLAY_WRITE
Specifies that this node allows writing to its object's continuous play information.
 o ALLOW_DURATION_READ
Specifies that this node allows access to its object's sound duration information.
 o ALLOW_ENABLE_READ
Specifies that this node allows access to its object's sound on information.
 o ALLOW_ENABLE_WRITE
Specifies that this node allows writing to its object's sound on information.
 o ALLOW_INITIAL_GAIN_READ
Specifies that this node allows access to its object's initial gain information.
 o ALLOW_INITIAL_GAIN_WRITE
Specifies that this node allows writing to its object's initial gain information.
 o ALLOW_IS_PLAYING_READ
Specifies that this node allows access to its object's sound playing information.
 o ALLOW_LOOP_READ
Specifies that this node allows access to its object's loop information.
 o ALLOW_LOOP_WRITE
Specifies that this node allows writing to its object's loop information.
 o ALLOW_PRIORITY_READ
Specifies that this node allows read access to its priority order value.
 o ALLOW_PRIORITY_WRITE
Specifies that this node allows write access to its priority order value.
 o ALLOW_RELEASE_READ
Specifies that this node allows access to its object's release flag information.
 o ALLOW_RELEASE_WRITE
Specifies that this node allows writing to its object's release flag information.
 o ALLOW_SCHEDULING_BOUNDS_READ
Specifies that this node allows read access to its scheduling bounds information.
 o ALLOW_SCHEDULING_BOUNDS_WRITE
Specifies that this node allows write access to its scheduling bounds information.
 o ALLOW_SOUND_DATA_READ
Specifies that this node allows access to its object's sound data information.
 o ALLOW_SOUND_DATA_WRITE
Specifies that this node allows writing to its object's sound data information.

Constructor Index

 o Sound()
Constructs & initializes a new Sound node using the following defaults:
 o Sound(MediaContainer, float)
Constructs and initializes a new Sound node object using the provided data and gain parameter values, and defaults for all other fields.
 o Sound(MediaContainer, float, int, boolean, boolean, boolean, Bounds, float)
Constructs and initializes a new Sound node using provided parameter values.

Method Index

 o getContinuousEnable()
Retrieves sound's continuous play flag.
 o getDuration()
Get the Sound's duration
 o getEnable()
Retrieves sound's enabled flag.
 o getInitialGain()
Get the overall gain applied to the sound data associated with source.
 o getLoop()
Retrieves loop count for this sound
 o getPriority()
Retrieves sound's priority value.
 o getReleaseEnable()
Retrieves release flag for sound associated with sound.
 o getSchedulingBoundingLeaf()
Retrieves the Sound node's scheduling bounding leaf.
 o getSchedulingBounds()
Retrieves the Sound node's scheduling bounds.
 o getSoundData()
Retrieves description/data associated with this sound source.
 o isPlaying()
Retrieves sound's play status.
 o setContinuousEnable(boolean)
Enables or disables continuous play flag.
 o setEnable(boolean)
Enable or disable sound.
 o setInitialGain(float)
Set the overall gain scale factor applied to data associated with this source to increase or decrease its overall amplitude.
 o setLoop(int)
Sets a sound's loop count.
 o setPriority(float)
Set sound's priority value.
 o setReleaseEnable(boolean)
Enables or disables the release flag for the sound associated with this sound.
 o setSchedulingBoundingLeaf(BoundingLeaf)
Set the Sound's scheduling region to the specified bounding leaf.
 o setSchedulingBounds(Bounds)
Set the Sound's scheduling region to the specified bounds.
 o setSoundData(MediaContainer)
Sets fields that define the sound source data of this node.

Variables

 o ALLOW_SOUND_DATA_READ
 public static final int ALLOW_SOUND_DATA_READ
Specifies that this node allows access to its object's sound data information.

 o ALLOW_SOUND_DATA_WRITE
 public static final int ALLOW_SOUND_DATA_WRITE
Specifies that this node allows writing to its object's sound data information.

 o ALLOW_INITIAL_GAIN_READ
 public static final int ALLOW_INITIAL_GAIN_READ
Specifies that this node allows access to its object's initial gain information.

 o ALLOW_INITIAL_GAIN_WRITE
 public static final int ALLOW_INITIAL_GAIN_WRITE
Specifies that this node allows writing to its object's initial gain information.

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

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

 o ALLOW_RELEASE_READ
 public static final int ALLOW_RELEASE_READ
Specifies that this node allows access to its object's release flag information.

 o ALLOW_RELEASE_WRITE
 public static final int ALLOW_RELEASE_WRITE
Specifies that this node allows writing to its object's release flag information.

 o ALLOW_CONT_PLAY_READ
 public static final int ALLOW_CONT_PLAY_READ
Specifies that this node allows access to its object's continuous play information.

 o ALLOW_CONT_PLAY_WRITE
 public static final int ALLOW_CONT_PLAY_WRITE
Specifies that this node allows writing to its object's continuous play information.

 o ALLOW_ENABLE_READ
 public static final int ALLOW_ENABLE_READ
Specifies that this node allows access to its object's sound on information.

 o ALLOW_ENABLE_WRITE
 public static final int ALLOW_ENABLE_WRITE
Specifies that this node allows writing to its object's sound on information.

 o ALLOW_SCHEDULING_BOUNDS_READ
 public static final int ALLOW_SCHEDULING_BOUNDS_READ
Specifies that this node allows read access to its scheduling bounds information.

 o ALLOW_SCHEDULING_BOUNDS_WRITE
 public static final int ALLOW_SCHEDULING_BOUNDS_WRITE
Specifies that this node allows write access to its scheduling bounds information.

 o ALLOW_PRIORITY_READ
 public static final int ALLOW_PRIORITY_READ
Specifies that this node allows read access to its priority order value.

 o ALLOW_PRIORITY_WRITE
 public static final int ALLOW_PRIORITY_WRITE
Specifies that this node allows write access to its priority order value.

 o ALLOW_DURATION_READ
 public static final int ALLOW_DURATION_READ
Specifies that this node allows access to its object's sound duration information.

 o ALLOW_IS_PLAYING_READ
 public static final int ALLOW_IS_PLAYING_READ
Specifies that this node allows access to its object's sound playing information.

Constructors

 o Sound
 public Sound()
Constructs & initializes a new Sound node using the following defaults:

 o Sound
 public Sound(MediaContainer soundData,
              float initialGain)
Constructs and initializes a new Sound node object using the provided data and gain parameter values, and defaults for all other fields. This constructor implicitly loads the sound data associated with this node if the implementation uses sound caching.

Parameters:
soundData - description of JMF source data used by this sound source
initialGain - overall amplitude scale factor applied to sound source
 o Sound
 public Sound(MediaContainer soundData,
              float initialGain,
              int loopCount,
              boolean release,
              boolean continuous,
              boolean enable,
              Bounds region,
              float priority)
Constructs and initializes a new Sound node using provided parameter values.

Parameters:
soundData - description of JMF source data used by this sound source
initialGain - overall amplitude scale factor applied to sound source
loopCount - number of times sound is looped when played
release - flag denoting sound is to be played to end when stopped
continuous - denotes that sound silently plays when disabled
enable - sound switched on/off
region - scheduling bounds
priority - defines playback priority if too many sounds started

Methods

 o setSoundData
 public void setSoundData(MediaContainer soundData)
Sets fields that define the sound source data of this node.

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
 o getSoundData
 public final MediaContainer getSoundData()
Retrieves description/data associated with this sound source.

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
 o setInitialGain
 public void setInitialGain(float amplitude)
Set the overall gain scale factor applied to data associated with this source to increase or decrease its overall amplitude.

Parameters:
amplitude - (gain) scale factor
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getInitialGain
 public final float getInitialGain()
Get the overall gain applied to the sound data associated with source.

Returns:
overall gain scale factor applied to sound source data.
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setLoop
 public final void setLoop(int loopCount)
Sets a sound's loop count.

Parameters:
loopCount - number of times sound is looped during play
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getLoop
 public final int getLoop()
Retrieves loop count for this sound

Returns:
loop count
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setReleaseEnable
 public final void setReleaseEnable(boolean state)
Enables or disables the release flag for the sound associated with this sound.

Parameters:
state - release flag
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getReleaseEnable
 public final boolean getReleaseEnable()
Retrieves release flag for sound associated with sound.

Returns:
sound's release flag
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setContinuousEnable
 public final void setContinuousEnable(boolean state)
Enables or disables continuous play flag.

Parameters:
state - denotes if deactivated sound silently continues playing
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getContinuousEnable
 public final boolean getContinuousEnable()
Retrieves sound's continuous play flag.

Returns:
flag denoting if deactivated sound silently continues playing
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setEnable
 public void setEnable(boolean state)
Enable or disable sound.

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
 o getEnable
 public final boolean getEnable()
Retrieves sound's enabled flag.

Returns:
sound enabled flag
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setSchedulingBounds
 public final void setSchedulingBounds(Bounds region)
Set the Sound's scheduling region to the specified bounds. This is used when the scheduling bounding leaf is set to null.

Parameters:
region - the bounds that contains the Sound's new scheduling region.
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getSchedulingBounds
 public final Bounds getSchedulingBounds()
Retrieves the Sound node's scheduling bounds.

Returns:
this Sound's scheduling bounds information
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setSchedulingBoundingLeaf
 public final void setSchedulingBoundingLeaf(BoundingLeaf region)
Set the Sound's scheduling region to the specified bounding leaf. When set to a value other than null, this overrides the scheduling bounds object.

Parameters:
region - the bounding leaf node used to specify the Sound node's new scheduling region.
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getSchedulingBoundingLeaf
 public final BoundingLeaf getSchedulingBoundingLeaf()
Retrieves the Sound node's scheduling bounding leaf.

Returns:
this Sound's scheduling bounding leaf information
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setPriority
 public void setPriority(float priority)
Set sound's priority value.

Parameters:
priority - value used to order sound's importance for playback.
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getPriority
 public final float getPriority()
Retrieves sound's priority value.

Returns:
sound priority value
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getDuration
 public final long getDuration()
Get the Sound's duration

Returns:
this Sound's duration in milliseconds including repeated loops
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o isPlaying
 public final boolean isPlaying()
Retrieves sound's play status.

Returns:
flag denoting if sound is playing or not
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph

All Packages  Class Hierarchy  This Package  Previous  Next  Index