public class JOALMixer extends AudioEngine3DL2 implements AudioDevice, AudioDevice3D, AudioDevice3DL2
BACKGROUND_SOUND, BUFFERED_AUDIO_DATA, CONE_SOUND, POINT_SOUND, STREAMING_AUDIO_DATAHEADPHONES, MONO_SPEAKER, STEREO_SPEAKERS| Constructor and Description |
|---|
JOALMixer(PhysicalEnvironment physicalEnvironment)
Creates a new instance of JOALMixer
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearSound(int index)
Clear Sound.
|
boolean |
close()
NOT IMPLEMENTED
Code to close the device |
static void |
exitOpenAL()
Unused code for to release resources created with the function above.
|
float |
getAngleOffsetToSpeaker()
Get Angle Offset To Speaker returns value set as angle between vector to speaker and Z head axis
|
int |
getAudioPlaybackType()
Get Type of Audio Playback Output Device returns audio playback type to which sound is currently output
|
float |
getCenterEarToSpeaker()
Get Distance from Ear to Speaker returns value set as distance from listener's ear to speaker
|
int |
getChannelsAvailable()
NOT IMPLEMENTED
Query number of channels currently available for use by the returns number of sound channels currently available (number not being used by active sounds). |
int |
getChannelsUsedForSound(Sound sound)
Deprecated.
This method is now part of the Sound class
|
int |
getNumberOfChannelsUsed(int index)
NOT IMPLEMENTED
Get number of channels used by a particular sample on the audio device. |
int |
getNumberOfChannelsUsed(int index,
boolean muteFlag)
NOT IMPLEMENTED
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)
NOT IMPLEMENTED
Get time this sample begun playing on the audio device. |
int |
getTotalChannels()
NOT IMPLEMENTED
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 |
pause()
NOT IMPLEMENTED
Pauses audio device engine without closing the device and associated threads. |
void |
pauseSample(int index)
Pause sample.
|
int |
prepareSound(int soundType,
MediaContainer soundData)
Prepare Sound in device
Makes sound assessible to device - in this case attempts to load sound Stores sound type and data. |
void |
resume()
NOT IMPLEMENTED
Resumes audio device engine (if previously paused) without reinitializing the device. |
void |
setAngleOffsetToSpeaker(float angle)
Set Angle Offset To Speaker
|
void |
setAngularAttenuation(int index,
int filterType,
double[] angle,
float[] attenuationScaleFactor,
float[] filterCutoff)
Set angular attenuation arrays affecting angular amplitude attenuation and angular distance filtering
Angular attenuation in OpenAL/JOAL is determined by AL_CONE_INNER_ANGLE, AL_CONE_OUTER_ANGLE and AL_CONE_OUTER_GAIN The region inside and AL_CONE_OUTER_ANGLE has its gain unchanged (AL_GAIN), the region inside AL_CONE_INNER_ANGLE and AL_CONE_OUTER_ANGLE has its gain between AL_GAIN and AL_CONE_OUTER_GAIN, and the region outside AL_CONE_OUTER_ANGLE has gain of AL_CONE_OUTER_GAIN This function calculates the AL_CONE_INNER_ANGLE, AL_CONE_OUTER_ANGLE and AL_CONE_OUTER_GAIN from the given angular attenuation data from Java3D. |
void |
setAudioPlaybackType(int type)
Set Type of Audio Playback physical transducer(s) sound is output to
Valid types are HEADPHONE, MONO_SPEAKER, STEREO_SPEAKERS |
void |
setCenterEarToSpeaker(float distance)
Set Distance from the Center Ear to a Speaker
|
void |
setDecayFilter(float frequencyCutoff)
NOT IMPLEMENTED
Set reverb decay filter This provides for frequencies above the given cutoff frequency to be attenuated during reverb decay at a different rate than frequencies below this value Thus, defining a different reverb decay curve for frequencies above the cutoff value. |
void |
setDecayTime(float time)
NOT IMPLEMENTED
Set reverb decay time Defines the reverberation decay curve. |
void |
setDensity(float density)
NOT IMPLEMENTED
Set reverb density This defines the modal density (also referred to as 'spectral coloration') The value of this parameter is expressed as a percent of the audio device's minimum-to-maximum values for this reverb parameter. |
void |
setDiffusion(float diffusion)
NOT IMPLEMENTED
Set reverb diffusion This defines the echo dispersement (also referred to as 'echo density') The value of this reverb parameter is expressed as a percent of the audio device's minimum-to-maximum values. |
void |
setDirection(int index,
Vector3d direction)
Set direction vector of sample.
|
void |
setDistanceFilter(int filterType,
double[] distance,
float[] dist)
NOT IMPLEMENTED
Set distance filter for current aural attribute applied to all samples. |
void |
setDistanceGain(int index,
double[] frontDistance,
float[] frontAttenuationScaleFactor,
double[] backDistance,
float[] backAttenuationScaleFactor)
Set elliptical distance attenuation arrays applied to sample amplitude
OPENAL/JOAL calculates the distance attenuation using its default model which is the inverse distance clamped model (equivalent to the IASIG I3DL2 distance model) This is: distance = max(distance, AL_REFERENCE_DISTANCE); distance = max(distance, AL_MAX_DISTANCE); gain = AL_REFERENCE_DISTANCE / (AL_REFERENCE_DISTANCE + AL_ROLLOFF_FACTOR * (distance - AL_REFERENCE_DISTANCE)); This function calculates the AL_REFERENCE_DISTANCE, AL_MAX_DISTANCE and AL_ROLLOFF_FACTOR from the given distance attenuation data from Java3D. |
void |
setFrequencyScaleFactor(float frequencyScaleFactor)
NOT IMPLEMENTED
Set frequency scale factor for current aural attribute applied to all samples. |
void |
setGain(float scaleFactor)
Set overall gain control of all sounds playing on the audio device.
|
void |
setLoop(int index,
int count)
NOT IMPLEMENTED COMPLETELY
Set number of times sample is looped Works for values 0 (no loop) and (-1) infinite loop but not for a fix number of loops (>1) |
void |
setObstructionFilter(int index,
float frequencyCutoff)
NOT IMPLEMENTED
Set the obstruction filter control This provides for frequencies above the given cutoff frequency to be attenuated, during while the gain of an obstruction signal is being calculated, at a different rate than frequencies below this value. |
void |
setObstructionGain(int index,
float scaleFactor)
NOT IMPLEMENTED
Set the obstruction gain control This method allows for attenuating sound waves traveling between the sound source and the listener obstructed by objects Direct sound signals/waves for obstructed sound source are attenuated but not indirect (reflected) waves. |
void |
setOcclusionFilter(int index,
float frequencyCutoff)
NOT IMPLEMENTED
Set the occlusion filter control This provides for frequencies above the given cutoff frequency to be attenuated, during while the gain of an occluded signal is being calculated, at a different rate than frequencies below this value There is no corresponding Core AuralAttributes method at this time. |
void |
setOcclusionGain(int index,
float scaleFactor)
NOT IMPLEMENTED
Set the occlusion gain control This method allows for attenuating sound waves traveling between the sound source and the listener occluded by objects Both direct and indirect sound signals/waves for occluded sound sources are attenuated There is no corresponding Core AuralAttributes method at this time. |
void |
setPosition(int index,
Point3d position)
Set location of sample.
|
void |
setRateScaleFactor(int index,
float scaleFactor)
Set scale factor applied to sample playback rate for a particular sound associated with the audio device
Changing the device sample rate affects both the pitch and speed. |
void |
setReflectionCoefficient(float coefficient)
NOT IMPLEMENTED
Set reverberation surface reflection coefficient value for current aural attribute applied to all samples. |
void |
setReflectionDelay(float reflectionDelay)
NOT IMPLEMENTED Sets the early reflection delay time
In this form, the parameter specifies the delay time between each order of reflection (while reverberation is being rendered) explicitly given in milliseconds. |
void |
setReverbCoefficient(float coefficient)
NOT IMPLEMENTED
Set late reflection (referred to as 'reverb') attenuation. |
void |
setReverbDelay(float reverbDelay)
NOT IMPLEMENTED
Set reverberation delay time for current aural attribute applied to all samples. |
void |
setReverbOrder(int reverbOrder)
NOT IMPLEMENTED
Set reverberation order for current aural attribute applied to all samples. |
void |
setRolloff(float rolloff)
NOT IMPLEMENTED
Set rolloff value for current aural attribute applied to all samples. |
void |
setSampleGain(int index,
float scaleFactor)
Set gain scale factor applied to sample.
|
void |
setVelocityScaleFactor(float velocityScaleFactor)
NOT IMPLEMENTED
Set velocity scale factor for current aural attribute applied to all samples when Doppler is calculated. |
void |
setView(View reference)
Save a reference to the current View object.
|
void |
setVworldXfrm(int index,
Transform3D trans)
DOES NOTHING - does not need to do anything special for JOAL
Set the transform for 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)
DOES NOTHING - not really needed when using JOAL
Update sample Implies that some parameters affecting rendering have been modified. |
getAuralParameters, getSample, getSampleListSize, getViewpublic JOALMixer(PhysicalEnvironment physicalEnvironment)
public void setGain(float scaleFactor)
setGain in interface AudioDevice3DL2setGain in class AudioEngine3DL2scaleFactor - scale factor applied to calculated amplitudes for all sounds playing on this devicepublic void resume()
resume in interface AudioDevice3DL2resume in class AudioEngine3DL2public void pause()
pause in interface AudioDevice3DL2pause in class AudioEngine3DL2public void setView(View reference)
setView in interface AudioDevice3DsetView in class AudioEngine3Dreference - to current view objectpublic int prepareSound(int soundType,
MediaContainer soundData)
prepareSound in interface AudioDevice3DprepareSound in class AudioEngine3DsoundType - denotes type of sound: Background, Point or ConesoundData - descrition of sound source datapublic void clearSound(int index)
clearSound in interface AudioDevice3DclearSound in class AudioEngine3Dindex - device specific reference number to device driver samplepublic long getSampleDuration(int index)
getSampleDuration in interface AudioDevice3DgetSampleDuration in class AudioEngine3Dindex - device specific reference number to device driver samplepublic int getNumberOfChannelsUsed(int index)
getNumberOfChannelsUsed in interface AudioDevice3DgetNumberOfChannelsUsed in class AudioEngine3Dindex - device specific reference number to device driver samplepublic int getNumberOfChannelsUsed(int index,
boolean muteFlag)
getNumberOfChannelsUsed in interface AudioDevice3DgetNumberOfChannelsUsed in class AudioEngine3Dindex - device specific reference number to device driver samplemuteFlag - 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.public int startSample(int index)
startSample in interface AudioDevice3DstartSample in class AudioEngine3Dindex - device specific reference number to device driver samplepublic long getStartTime(int index)
getStartTime in interface AudioDevice3DgetStartTime in class AudioEngine3Dindex - device specific reference number to device driver samplepublic int stopSample(int index)
stopSample in interface AudioDevice3DstopSample in class AudioEngine3Dindex - device specific reference number to device driver samplepublic void setSampleGain(int index,
float scaleFactor)
setSampleGain in interface AudioDevice3DsetSampleGain in class AudioEngine3Dindex - device specific reference number to device driver samplescaleFactor - floating point multiplier applied to sample amplitudepublic void setLoop(int index,
int count)
setLoop in interface AudioDevice3DsetLoop in class AudioEngine3Dindex - device specific reference number to device driver samplecount - number of times sample is repeatedSound.setLoop(int)public void setVworldXfrm(int index,
Transform3D trans)
setVworldXfrm in interface AudioDevice3DsetVworldXfrm in class AudioEngine3Dindex - device specific reference number to device driver sampletrans - is a reference to virtual world composite transformpublic void setPosition(int index,
Point3d position)
setPosition in interface AudioDevice3DsetPosition in class AudioEngine3Dindex - device specific reference number to device driver sampleposition - point location in virtual world coordinate of samplePointSound.setPosition(float x, float y, float z),
PointSound.setPosition(Point3f position)public void setDistanceGain(int index,
double[] frontDistance,
float[] frontAttenuationScaleFactor,
double[] backDistance,
float[] backAttenuationScaleFactor)
setDistanceGain in interface AudioDevice3DsetDistanceGain in class AudioEngine3Dindex - device specific reference number to device driver samplefrontDistance - defines an array of distance along the position axis thru which ellipses passfrontAttenuationScaleFactor - gain scale factorsbackDistance - defines an array of distance along the negative axis thru which ellipses passbackAttenuationScaleFactor - gain scale factorsConeSound.setDistanceGain(float[] frontDistance, float[] frontGain,
float[] backDistance, float[] backGain),
ConeSound.setDistanceGain(Point2f[] frontAttenuation,
Point2f[] backAttenuation)public void setDirection(int index,
Vector3d direction)
setDirection in interface AudioDevice3DsetDirection in class AudioEngine3Dindex - device specific reference number to device driver sampledirection - vector in virtual world coordinate.ConeSound.setDirection(float x, float y, float z),
ConeSound.setDirection(Vector3f direction)public void setAngularAttenuation(int index,
int filterType,
double[] angle,
float[] attenuationScaleFactor,
float[] filterCutoff)
setAngularAttenuation in interface AudioDevice3DsetAngularAttenuation in class AudioEngine3Dindex - device specific reference number to device driver samplefilterType - denotes type of filtering (on no filtering) applied to sample.angle - array containing angular distances from sound axisattenuationScaleFactor - array containing gain scale factorfilterCutoff - array containing filter cutoff frequencies. The filter values for each tuples can be set to
Sound.NO_FILTER.ConeSound.setAngularAttenuation(float[] distance, float[] gain,
float[] filter),
ConeSound.setAngularAttenuation(Point3f[] attenuation),
ConeSound.setAngularAttenuation(Point2f[] attenuation)public void setRolloff(float rolloff)
setRolloff in interface AudioDevice3DsetRolloff in class AudioEngine3Drolloff - scale factor applied to standard speed of sound.AuralAttributes.setRolloff(float)public void setReflectionCoefficient(float coefficient)
setReflectionCoefficient in interface AudioDevice3DsetReflectionCoefficient in class AudioEngine3Dcoefficient - applied to amplitude of reverbation added at each iteration of reverb processing.AuralAttributes.setReflectionCoefficient(float)public void setReverbDelay(float reverbDelay)
setReverbDelay in interface AudioDevice3DsetReverbDelay in class AudioEngine3DreverbDelay - amount of time in millisecond between each iteration of reverb processing.AuralAttributes.setReverbDelay(float reverbDelay)public void setReverbOrder(int reverbOrder)
setReverbOrder in interface AudioDevice3DsetReverbOrder in class AudioEngine3DreverbOrder - number of times reverb process loop is iterated.AuralAttributes.setReverbOrder(int)public void setDistanceFilter(int filterType,
double[] distance,
float[] dist)
setDistanceFilter in interface AudioDevice3DsetDistanceFilter in class AudioEngine3DfilterType - denotes type of filtering (on no filtering) applied to all sample based on distance between listener
and sound.dist - is an attenuation array of distance and low-pass filter values.distance - is an attenuation array of distance and low-pass filter values.AuralAttributes.setDistanceFilter(float[] distance,
float[] frequencyCutoff),
AuralAttributes.setDistanceFilter(Point2f[] attenuation)public void setFrequencyScaleFactor(float frequencyScaleFactor)
setFrequencyScaleFactor in interface AudioDevice3DsetFrequencyScaleFactor in class AudioEngine3DfrequencyScaleFactor - frequency scale factor applied to samples normal playback rate.AuralAttributes.setFrequencyScaleFactor(float)public void setVelocityScaleFactor(float velocityScaleFactor)
setVelocityScaleFactor in interface AudioDevice3DsetVelocityScaleFactor in class AudioEngine3DvelocityScaleFactor - scale factor applied to postional samples' listener-to-soundSource velocity. playback rate.AuralAttributes.setVelocityScaleFactor(float)public void muteSample(int index)
muteSample in interface AudioDevice3DmuteSample in class AudioEngine3Dindex - device specific reference number to device driver samplepublic void unmuteSample(int index)
unmuteSample in interface AudioDevice3DunmuteSample in class AudioEngine3Dindex - device specific reference number to device driver samplepublic void pauseSample(int index)
pauseSample in interface AudioDevice3DpauseSample in class AudioEngine3Dindex - device specific reference number to device driver samplepublic void unpauseSample(int index)
unpauseSample in interface AudioDevice3DunpauseSample in class AudioEngine3Dindex - device specific reference number to device driver samplepublic void updateSample(int index)
updateSample in interface AudioDevice3DupdateSample in class AudioEngine3Dindex - device specific reference number to device driver samplepublic boolean initialize()
initialize in interface AudioDeviceinitialize in class AudioEnginepublic boolean close()
close in interface AudioDeviceclose in class AudioEnginepublic void setAudioPlaybackType(int type)
setAudioPlaybackType in interface AudioDevicesetAudioPlaybackType in class AudioEnginetype - of audio output devicepublic int getAudioPlaybackType()
getAudioPlaybackType in interface AudioDevicegetAudioPlaybackType in class AudioEnginepublic void setCenterEarToSpeaker(float distance)
setCenterEarToSpeaker in interface AudioDevicesetCenterEarToSpeaker in class AudioEnginedistance - from the center ear and to the speakerpublic float getCenterEarToSpeaker()
getCenterEarToSpeaker in interface AudioDevicegetCenterEarToSpeaker in class AudioEnginepublic void setAngleOffsetToSpeaker(float angle)
setAngleOffsetToSpeaker in interface AudioDevicesetAngleOffsetToSpeaker in class AudioEngineangle - in radian between head coordinate Z axis and vector to speakerpublic float getAngleOffsetToSpeaker()
getAngleOffsetToSpeaker in interface AudioDevicegetAngleOffsetToSpeaker in class AudioEnginepublic int getTotalChannels()
getTotalChannels in interface AudioDevicegetTotalChannels in class AudioEnginepublic int getChannelsAvailable()
getChannelsAvailable in interface AudioDevicegetChannelsAvailable in class AudioEnginepublic int getChannelsUsedForSound(Sound sound)
getChannelsUsedForSound in interface AudioDevicegetChannelsUsedForSound in class AudioEnginesound - refenence to sound node that query to be performed on returns number of sound channels used by a
specific Sound nodepublic void setRateScaleFactor(int index,
float scaleFactor)
setRateScaleFactor in interface AudioDevice3DL2setRateScaleFactor in class AudioEngine3DL2index - device specific reference to device driver samplescaleFactor - non-negative factor applied to calculated amplitudes for all sounds playing on this deviceSound.setRateScaleFactor(float)public void setReverbCoefficient(float coefficient)
setReverbCoefficient in interface AudioDevice3DL2setReverbCoefficient in class AudioEngine3DL2coefficient - late reflection attenuation factorAuralAttributes.setReverbCoefficient(float)public void setReflectionDelay(float reflectionDelay)
setReflectionDelay in interface AudioDevice3DL2setReflectionDelay in class AudioEngine3DL2reflectionDelay - time between each order of early reflectionAuralAttributes.setReflectionDelay(float)public void setDecayTime(float time)
setDecayTime in interface AudioDevice3DL2setDecayTime in class AudioEngine3DL2time - decay time in millisecondsAuralAttributes.setDecayTime(float)public void setDecayFilter(float frequencyCutoff)
setDecayFilter in interface AudioDevice3DL2setDecayFilter in class AudioEngine3DL2frequencyCutoff - value of frequencies in Hertz above which a low-pass filter is applied.AuralAttributes.setDecayFilter(float)public void setDiffusion(float diffusion)
setDiffusion in interface AudioDevice3DL2setDiffusion in class AudioEngine3DL2diffusion - percentage expressed within the range of 0.0 and 1.0AuralAttributes.setDiffusion(float)public void setDensity(float density)
setDensity in interface AudioDevice3DL2setDensity in class AudioEngine3DL2density - reverb density expressed as a percentage, within the range of 0.0 and 1.0AuralAttributes.setDensity(float)public void setObstructionGain(int index,
float scaleFactor)
setObstructionGain in interface AudioDevice3DL2setObstructionGain in class AudioEngine3DL2index - device specific reference to device driver samplescaleFactor - non-negative factor applied to direct sound gainpublic void setObstructionFilter(int index,
float frequencyCutoff)
setObstructionFilter in interface AudioDevice3DL2setObstructionFilter in class AudioEngine3DL2index - device specific reference to device driver samplefrequencyCutoff - value of frequencies in Hertz above which a low-pass filter is applied.public void setOcclusionGain(int index,
float scaleFactor)
setOcclusionGain in interface AudioDevice3DL2setOcclusionGain in class AudioEngine3DL2index - device specific reference to device driver samplescaleFactor - non-negative factor applied to direct sound gainpublic void setOcclusionFilter(int index,
float frequencyCutoff)
setOcclusionFilter in interface AudioDevice3DL2setOcclusionFilter in class AudioEngine3DL2index - device specific reference to device driver samplefrequencyCutoff - value of frequencies in Hertz above which a low-pass filter is applied.public static void exitOpenAL()