com.sun.j3d.audioengines.javasound
Class JavaSoundMixer

java.lang.Object
  |
  +--com.sun.j3d.audioengines.AudioEngine
        |
        +--com.sun.j3d.audioengines.AudioEngine3D
              |
              +--com.sun.j3d.audioengines.javasound.JavaSoundMixer

public class JavaSoundMixer
extends AudioEngine3D

The JavaSoundMixer Class defines an audio output device that accesses JavaSound JavaSoundMixer functionality Hae stream data.


Fields inherited from class com.sun.j3d.audioengines.AudioEngine3D
attribs, currentView, samples
 
Constructor Summary
JavaSoundMixer(PhysicalEnvironment physicalEnvironment)
           
 
Method Summary
 void clearSound(int index)
          Clears the fields associated with sample data for this sound.
 boolean close()
          Code to close the device
 int getNumberOfChannelsUsed(int index)
          Get number of channels used by a particular sample on the audio device.
 int getNumberOfChannelsUsed(int index, boolean muted)
          Get number of channels that would be used by a particular sample on the audio device given the mute flag passed in as a parameter.
 long getSampleDuration(int index)
          Get length of time a sample would play if allowed to play to completion.
 long getStartTime(int index)
          Get time this sample begun playing on the audio device.
 int getTotalChannels()
          Query total number of channels available for sound rendering for this audio device.
 boolean initialize()
          Code to initialize the device
 void muteSample(int index)
          Mute sample.
 void pauseSample(int index)
          Pause sample.
 int prepareSound(int soundType, MediaContainer soundData)
          Code to load sound data into a channel of device channel
 void setDirection(int index, Vector3d direction)
          Set direction vector of sample.
 void setLoop(int index, int count)
          Set number of times sample is looped.
 void setPosition(int index, Point3d position)
          Set location of sample.
 void setReflectionCoefficient(float coefficient)
          Set reverberation surface reflection coefficient value for current aural attribute applied to all samples.
 void setReverbDelay(float reverbDelay)
          Set reverberation delay time for current aural attribute applied to all samples.
 void setReverbOrder(int reverbOrder)
          Set reverberation order for current aural attribute applied to all samples.
 void setVworldXfrm(int index, Transform3D trans)
          Save a reference to the local to virtual world coordinate space
 int startSample(int index)
          Start sample playing on audio device
 int stopSample(int index)
          Stop sample playing on audio device
 void unmuteSample(int index)
          Unmute sample.
 void unpauseSample(int index)
          Unpause sample.
 void updateSample(int index)
          Update sample.
 
Methods inherited from class com.sun.j3d.audioengines.AudioEngine3D
getAuralParameters, getSampleList, getView, setAngularAttenuation, setDistanceFilter, setDistanceGain, setFrequencyScaleFactor, setRolloff, setSampleGain, setVelocityScaleFactor, setView
 
Methods inherited from class com.sun.j3d.audioengines.AudioEngine
getAngleOffsetToSpeaker, getAudioPlaybackType, getCenterEarToSpeaker, getChannelsAvailable, getChannelsUsedForSound, setAngleOffsetToSpeaker, setAudioPlaybackType, setCenterEarToSpeaker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaSoundMixer

public JavaSoundMixer(PhysicalEnvironment physicalEnvironment)
Method Detail

getTotalChannels

public int getTotalChannels()
Query total number of channels available for sound rendering for this audio device.
Overrides:
getTotalChannels in class AudioEngine
Tags copied from interface: AudioDevice
Returns:
total number of channels that can be used for this audio device

initialize

public boolean initialize()
Code to initialize the device
Overrides:
initialize in class AudioEngine
Returns:
flag: true is initialized sucessfully, false if error

close

public boolean close()
Code to close the device
Overrides:
close in class AudioEngine
Returns:
flag: true is closed sucessfully, false if error

prepareSound

public int prepareSound(int soundType,
                        MediaContainer soundData)
Code to load sound data into a channel of device channel
Overrides:
prepareSound in class AudioEngine3D
Returns:
index of sound

clearSound

public void clearSound(int index)
Clears the fields associated with sample data for this sound.
Overrides:
clearSound in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample

setVworldXfrm

public void setVworldXfrm(int index,
                          Transform3D trans)
Save a reference to the local to virtual world coordinate space
Overrides:
setVworldXfrm in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample
reference - to virtual world composite transform

setPosition

public void setPosition(int index,
                        Point3d position)
Description copied from class: AudioEngine3D
Set location of sample.
Overrides:
setPosition in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample
position - point location in virtual world coordinate of sample

setDirection

public void setDirection(int index,
                         Vector3d direction)
Description copied from class: AudioEngine3D
Set direction vector of sample.
Overrides:
setDirection in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample
direction - vector in virtual world coordinate.

setReflectionCoefficient

public void setReflectionCoefficient(float coefficient)
Description copied from class: AudioEngine3D
Set reverberation surface reflection coefficient value for current aural attribute applied to all samples.
Overrides:
setReflectionCoefficient in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
coefficient - applied to amplitude of reverbation added at each iteration of reverb processing.

setReverbDelay

public void setReverbDelay(float reverbDelay)
Description copied from class: AudioEngine3D
Set reverberation delay time for current aural attribute applied to all samples.
Overrides:
setReverbDelay in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
reverbDelay - amount of time in millisecond between each iteration of reverb processing.

setReverbOrder

public void setReverbOrder(int reverbOrder)
Description copied from class: AudioEngine3D
Set reverberation order for current aural attribute applied to all samples.
Overrides:
setReverbOrder in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
reverbOrder - number of times reverb process loop is iterated.

startSample

public int startSample(int index)
Description copied from class: AudioEngine3D
Start sample playing on audio device
Overrides:
startSample in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample
Returns:
status: < 0 denotes an error

stopSample

public int stopSample(int index)
Description copied from class: AudioEngine3D
Stop sample playing on audio device
Overrides:
stopSample in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample
Returns:
status: < 0 denotes an error

pauseSample

public void pauseSample(int index)
Description copied from class: AudioEngine3D
Pause sample.
Overrides:
pauseSample in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample

unpauseSample

public void unpauseSample(int index)
Description copied from class: AudioEngine3D
Unpause sample.
Overrides:
unpauseSample in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample

updateSample

public void updateSample(int index)
Description copied from class: AudioEngine3D
Update sample. Implies that some parameters affecting rendering have been modified.
Overrides:
updateSample in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample

muteSample

public void muteSample(int index)
Description copied from class: AudioEngine3D
Mute sample.
Overrides:
muteSample in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample

unmuteSample

public void unmuteSample(int index)
Description copied from class: AudioEngine3D
Unmute sample.
Overrides:
unmuteSample in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample

getSampleDuration

public long getSampleDuration(int index)
Description copied from class: AudioEngine3D
Get length of time a sample would play if allowed to play to completion.
Overrides:
getSampleDuration in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample
Returns:
length of sample in milliseconds

getNumberOfChannelsUsed

public int getNumberOfChannelsUsed(int index)
Description copied from class: AudioEngine3D
Get number of channels used by a particular sample on the audio device.
Overrides:
getNumberOfChannelsUsed in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample
Returns:
number of channels currently being used by this sample.

getNumberOfChannelsUsed

public int getNumberOfChannelsUsed(int index,
                                   boolean muted)
Description copied from class: AudioEngine3D
Get number of channels that would be used by a particular sample on the audio device given the mute flag passed in as a parameter.
Overrides:
getNumberOfChannelsUsed in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample
muteFlag - denotes the mute state to assume while executing this query. This mute value does not have to match the current mute state of the sample.
Returns:
number of channels that would be used by this sample if it were playing.

getStartTime

public long getStartTime(int index)
Description copied from class: AudioEngine3D
Get time this sample begun playing on the audio device.
Overrides:
getStartTime in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample
Returns:
system clock time sample started

setLoop

public void setLoop(int index,
                    int count)
Description copied from class: AudioEngine3D
Set number of times sample is looped.
Overrides:
setLoop in class AudioEngine3D
Tags copied from class: AudioEngine3D
Parameters:
index - device specific reference number to device driver sample
count - number of times sample is repeated