de.jreality.scene
Class AudioSource

java.lang.Object
  extended by de.jreality.scene.SceneGraphNode
      extended by de.jreality.scene.AudioSource

public abstract class AudioSource
extends SceneGraphNode

The core of audio for jReality. The basic idea is that a scene graph component can have an audio source attached to it. Audio renderers request mono sample readers from audio sources, one for each occurrence of the source in the scene graph. An audio source keeps track of time in terms of the number of samples requested so far. Readers can read samples concurrently, and sample requests are queued and managed so that an audio source only writes as many samples as the fastest renderer requests. Samples are floats in the range from -1 to 1.

Author:
brinkman

Nested Class Summary
static class AudioSource.State
           
 
Constructor Summary
AudioSource(java.lang.String name)
           
 
Method Summary
 void accept(SceneGraphVisitor v)
          The accept method for a SceneGraphVisitor.
 void addAudioListener(AudioListener listener)
           
abstract  SampleReader createReader()
          The return value must be a new sample reader for each call; readers must be able to operate in parallel.
 AudioSource.State getState()
           
 void pause()
           
 void removeAudioListener(AudioListener listener)
           
 void setState(AudioSource.State state)
          set the state of the node.
 void start()
           
 void stop()
           
 
Methods inherited from class de.jreality.scene.SceneGraphNode
getName, getOwner, getThreadSafe, isReadOnly, setName, setOwner, setReadOnly, setThreadSafe, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AudioSource

public AudioSource(java.lang.String name)
Method Detail

createReader

public abstract SampleReader createReader()
The return value must be a new sample reader for each call; readers must be able to operate in parallel.

Returns:
a new sample reader for this source

setState

public void setState(AudioSource.State state)
set the state of the node.

Parameters:
state - the new state of the audio source

getState

public AudioSource.State getState()

start

public void start()

stop

public void stop()

pause

public void pause()

accept

public void accept(SceneGraphVisitor v)
Description copied from class: SceneGraphNode
The accept method for a SceneGraphVisitor.

Overrides:
accept in class SceneGraphNode

addAudioListener

public void addAudioListener(AudioListener listener)

removeAudioListener

public void removeAudioListener(AudioListener listener)