Aviatrix3D
2.1.0

org.j3d.aviatrix3d
Class ByteAudioComponent

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.NodeComponent
          extended by org.j3d.aviatrix3d.AudioComponent
              extended by org.j3d.aviatrix3d.ByteAudioComponent
All Implemented Interfaces:
AudioSource

public class ByteAudioComponent
extends AudioComponent

A Audio component that uses raw byte data to be interpreted by the format IDs passed in.

Version:
$Revision: 1.3 $
Author:
Alan Hudson

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.AudioComponent
data, format, frequency, loop, pitch
 
Fields inherited from class org.j3d.aviatrix3d.NodeComponent
lastParent, liveCount, parentList
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler
 
Fields inherited from interface org.j3d.aviatrix3d.AudioSource
FORMAT_MONO16, FORMAT_MONO8, FORMAT_SETERO8, FORMAT_STEREO16
 
Constructor Summary
ByteAudioComponent()
          Constructs a sound with default values.
ByteAudioComponent(int format, int frequency, boolean loop, byte[] srcData)
          Constructs a ByteAudioComponent using the specified format.
ByteAudioComponent(int format, int frequency, boolean loop, java.nio.ByteBuffer srcData)
          Constructs a ByteAudioComponent using the specified format.
 
Method Summary
 void clearLocalData()
          Clear the data backing for this Component.
 void setData(int format, int frequency, byte[] srcData, int seq)
          Set the data for this component.
 void setData(int format, int frequency, java.nio.ByteBuffer srcData, int seq)
          Set the data for this component.
 
Methods inherited from class org.j3d.aviatrix3d.AudioComponent
addUpdateListener, getBufferId, getFormat, getFrequency, getLoop, getPitch, removeUpdateListener, sendAudioUpdate, sendParamUpdate, setLoop, setPitch
 
Methods inherited from class org.j3d.aviatrix3d.NodeComponent
addParent, getParents, numParents, removeParent
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setLive, setUpdateHandler, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteAudioComponent

public ByteAudioComponent()
Constructs a sound with default values.


ByteAudioComponent

public ByteAudioComponent(int format,
                          int frequency,
                          boolean loop,
                          java.nio.ByteBuffer srcData)
Constructs a ByteAudioComponent using the specified format. This is the most effecient route to pass data in.

Parameters:
format - The audio format. FORMAT_MONO8,FORMAT_MONO16,FORMAT_STEREO8,FORMAT_STEREO16
frequency - The frequency of the samples
loop - True if this sample should be looped
srcData - The data to use

ByteAudioComponent

public ByteAudioComponent(int format,
                          int frequency,
                          boolean loop,
                          byte[] srcData)
Constructs a ByteAudioComponent using the specified format.

Parameters:
format - The audio format. FORMAT_MONO8,FORMAT_MONO16,FORMAT_STEREO8,FORMAT_STEREO16
frequency - The frequency of the samples.
loop - True if this sample should be looped
srcData - The data to use as a byte array
Method Detail

clearLocalData

public void clearLocalData()
Clear the data backing for this Component.

Specified by:
clearLocalData in class AudioComponent

setData

public void setData(int format,
                    int frequency,
                    byte[] srcData,
                    int seq)
Set the data for this component.

Parameters:
format - The audio format. FORMAT_MONO8,FORMAT_MONO16,FORMAT_STEREO8,FORMAT_STEREO16
frequency - The frequency of the samples.
srcData - The data.
seq - The seq being updated. 0 for non streaming data.

setData

public void setData(int format,
                    int frequency,
                    java.nio.ByteBuffer srcData,
                    int seq)
Set the data for this component.

Parameters:
format - The audio format. FORMAT_MONO8,FORMAT_MONO16,FORMAT_STEREO8,FORMAT_STEREO16
frequency - The frequency of the samples.
srcData - The data.
seq - The seq being updated. 0 for non streaming data.

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org