org.xith3d.sound
Interface SoundSource

All Known Implementing Classes:
SoundSourceImpl, SoundSourceImpl, SoundSourceImpl

public interface SoundSource

A Soundsource represents a single source of sound to be played.


Method Summary
 SoundDriver getSoundDriver()
           
 SoundState getState()
           
 boolean isPlaying()
           
 void pause()
           
 void play()
           
 void queueBuffer(SoundBuffer buffer)
          Description: Specify the current Buffer object, which means the head entry in its queue.
 void rewind()
           
 void setContainer(SoundContainer container)
          An alternate to explicitly providing the buffers via the queueBuffer method is to provide a sound data container which will generate the data needed to create the buffers.
 void setDirection(float dirX, float dirY, float dirZ)
          Description: If DIRECTION does not equal the zero vector, the Source is directional.
 void setDirection(org.openmali.vecmath2.Tuple3f direction)
          Description: If DIRECTION does not equal the zero vector, the Source is directional.
 void setLoop(boolean loop)
          LOOPING is a flag that indicates that the Source will not be in STOPPED state once it reaches the end of last buffer in the buffer queue.
 void setMaxDistance(float maxDistance)
           
 void setMaxTime(long ms)
           
 void setMaxVolume(float maxVolume)
           
 void setMinVolume(float minVolume)
           
 void setPosition(float posX, float posY, float posZ)
           
 void setPosition(org.openmali.vecmath2.Tuple3f position)
           
 void setReferenceDistance(float refDistance)
          REFERENCE_DISTANCE is the distance at which the Listener will experience GAIN (unless the implementation had to clamp effective GAIN to the available dynamic range).
 void setRelative(boolean relative)
          SOURCE_RELATIVE set to TRUE indicates that the values specified by POSITION are to be interpreted relative to the listener position
 void setRolloffFactor(float factor)
          ROLLOFF_FACTOR is per-Source parameter the application can use to increase or decrease the range of a source by decreasing or increasing the attenuation, respectively.
 void setVelocity(float veloX, float veloY, float veloZ)
           
 void setVelocity(org.openmali.vecmath2.Tuple3f velocity)
           
 void setVolume(float gain)
           
 void stop()
           
 

Method Detail

queueBuffer

void queueBuffer(SoundBuffer buffer)
Description: Specify the current Buffer object, which means the head entry in its queue. Using BUFFER with the Source command on a STOPPED or INITIAL Source empties the entire queue, then appends the one Buffer specified.

For a PLAYING or PAUSED Source, using the Source command with BUFFER is an INVALID_OPERATION. It can be applied to INITIAL and STOPPED Sources only. Specifying an invalid bufferName will result in an INVALID_VALUE error while specifying an invalid sourceName results in an INVALID_NAME error.


setContainer

void setContainer(SoundContainer container)
An alternate to explicitly providing the buffers via the queueBuffer method is to provide a sound data container which will generate the data needed to create the buffers. All the loaders provided in xith3d.sound.loaders create SoundDataContainers. Setting a sound container is the only way to play streaming sounds as the sound manager will make sure to continue to request sounds from the container.

Parameters:
container -

play

void play()

pause

void pause()

rewind

void rewind()

stop

void stop()

isPlaying

boolean isPlaying()

setPosition

void setPosition(float posX,
                 float posY,
                 float posZ)

setPosition

void setPosition(org.openmali.vecmath2.Tuple3f position)

setVelocity

void setVelocity(float veloX,
                 float veloY,
                 float veloZ)

setVelocity

void setVelocity(org.openmali.vecmath2.Tuple3f velocity)

setDirection

void setDirection(float dirX,
                  float dirY,
                  float dirZ)
Description: If DIRECTION does not equal the zero vector, the Source is directional. The sound emission is presumed to be symmetric around the direction vector (cylinder symmetry). Sources are not oriented in full 3 degrees of freedom, only two angles are effectively needed. The zero vector is default, indicating that a Source is not directional. Specifying a non-zero vector will make the Source directional. Specifying a zero vector for a directional Source will effectively mark it as nondirectional.


setDirection

void setDirection(org.openmali.vecmath2.Tuple3f direction)
Description: If DIRECTION does not equal the zero vector, the Source is directional. The sound emission is presumed to be symmetric around the direction vector (cylinder symmetry). Sources are not oriented in full 3 degrees of freedom, only two angles are effectively needed. The zero vector is default, indicating that a Source is not directional. Specifying a non-zero vector will make the Source directional. Specifying a zero vector for a directional Source will effectively mark it as nondirectional.


getState

SoundState getState()

setVolume

void setVolume(float gain)

setReferenceDistance

void setReferenceDistance(float refDistance)
REFERENCE_DISTANCE is the distance at which the Listener will experience GAIN (unless the implementation had to clamp effective GAIN to the available dynamic range).

Parameters:
refDistance -

setRolloffFactor

void setRolloffFactor(float factor)
ROLLOFF_FACTOR is per-Source parameter the application can use to increase or decrease the range of a source by decreasing or increasing the attenuation, respectively. The default value is 1. The implementation is free to optimize for a ROLLOFF_FACTOR value of 0, which indicates that the application does not wish any distance attenuation on the respective Source.

Parameters:
factor -

setRelative

void setRelative(boolean relative)
SOURCE_RELATIVE set to TRUE indicates that the values specified by POSITION are to be interpreted relative to the listener position

Parameters:
relative -

setLoop

void setLoop(boolean loop)
LOOPING is a flag that indicates that the Source will not be in STOPPED state once it reaches the end of last buffer in the buffer queue. Instead, the Source will immediately promote to INITIAL and PLAYING. The default value is FALSE. LOOPING can be changed on a Source in any execution state. In particular, it can be changed on a PLAYING Source

Parameters:
loop -

setMaxVolume

void setMaxVolume(float maxVolume)

setMinVolume

void setMinVolume(float minVolume)

setMaxDistance

void setMaxDistance(float maxDistance)

setMaxTime

void setMaxTime(long ms)

getSoundDriver

SoundDriver getSoundDriver()