de.jreality.scene
Class AudioSource
java.lang.Object
de.jreality.scene.SceneGraphNode
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
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AudioSource
public AudioSource(java.lang.String name)
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)