public class JavaSoundMixer extends AudioEngine3DL2
Modifier and Type | Field and Description |
---|---|
protected float |
deviceGain |
protected static int |
NOT_PAUSED |
protected int |
pause |
protected static int |
PAUSE_PENDING |
protected static int |
PAUSED |
protected static int |
RESUME_PENDING |
attribs, currentView, samples
BACKGROUND_SOUND, BUFFERED_AUDIO_DATA, CONE_SOUND, POINT_SOUND, STREAMING_AUDIO_DATA
HEADPHONES, MONO_SPEAKER, STEREO_SPEAKERS
Constructor and Description |
---|
JavaSoundMixer(PhysicalEnvironment physicalEnvironment) |
Modifier and Type | Method and Description |
---|---|
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)
Overriden method from AudioEngine3D.
|
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
New interface to mixer/engine specific methods
|
void |
muteSample(int index)
Mute sample.
|
void |
pause()
Pauses audio device engine without closing the device and associated
threads.
|
void |
pauseSample(int index)
Pause sample.
|
int |
prepareSound(int soundType,
MediaContainer soundData)
Code to load sound data into a channel of device mixer.
|
void |
resume()
Resumes audio device engine (if previously paused) without reinitializing * the device.
|
void |
setDirection(int index,
Vector3d direction)
Set direction vector of sample.
|
void |
setGain(float scaleFactor)
Set overall gain control of all sounds playing on the audio device.
|
void |
setLoop(int index,
int count)
Set number of times sample is looped.
|
void |
setPosition(int index,
Point3d position)
Set location of sample.
|
void |
setRateScaleFactor(int index,
float rateScaleFactor)
Set scale factor applied to sample playback rate for a particular sound
associated with the audio device.
|
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
Overriden method from AudioEngine3D.
|
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.
|
setDecayFilter, setDecayTime, setDensity, setDiffusion, setObstructionFilter, setObstructionGain, setOcclusionFilter, setOcclusionGain, setReflectionDelay, setReverbCoefficient
getAuralParameters, getSample, getSampleList, getSampleListSize, getView, setAngularAttenuation, setDistanceFilter, setDistanceGain, setFrequencyScaleFactor, setRolloff, setSampleGain, setVelocityScaleFactor, setView
getAngleOffsetToSpeaker, getAudioPlaybackType, getCenterEarToSpeaker, getChannelsAvailable, getChannelsUsedForSound, setAngleOffsetToSpeaker, setAudioPlaybackType, setCenterEarToSpeaker
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setAngularAttenuation, setDistanceFilter, setDistanceGain, setFrequencyScaleFactor, setRolloff, setSampleGain, setVelocityScaleFactor, setView
getAngleOffsetToSpeaker, getAudioPlaybackType, getCenterEarToSpeaker, getChannelsAvailable, getChannelsUsedForSound, setAngleOffsetToSpeaker, setAudioPlaybackType, setCenterEarToSpeaker
protected float deviceGain
protected static final int NOT_PAUSED
protected static final int PAUSE_PENDING
protected static final int PAUSED
protected static final int RESUME_PENDING
protected int pause
public JavaSoundMixer(PhysicalEnvironment physicalEnvironment)
public int getTotalChannels()
getTotalChannels
in interface AudioDevice
getTotalChannels
in class AudioEngine
public boolean initialize()
initialize
in interface AudioDevice
initialize
in class AudioEngine
public boolean close()
close
in interface AudioDevice
close
in class AudioEngine
public int prepareSound(int soundType, MediaContainer soundData)
prepareSound
in interface AudioDevice3D
prepareSound
in class AudioEngine3D
soundType
- denotes type of sound: Background, Point or ConesoundData
- descrition of sound source datapublic void clearSound(int index)
clearSound
in interface AudioDevice3D
clearSound
in class AudioEngine3D
index
- device specific reference number to device driver samplepublic void setVworldXfrm(int index, Transform3D trans)
setVworldXfrm
in interface AudioDevice3D
setVworldXfrm
in class AudioEngine3D
index
- device specific reference number to device driver sampletrans
- is a reference to virtual world composite transformpublic void setPosition(int index, Point3d position)
AudioEngine3D
setPosition
in interface AudioDevice3D
setPosition
in class AudioEngine3D
index
- 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 setDirection(int index, Vector3d direction)
AudioEngine3D
setDirection
in interface AudioDevice3D
setDirection
in class AudioEngine3D
index
- 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 setReflectionCoefficient(float coefficient)
AudioEngine3D
setReflectionCoefficient
in interface AudioDevice3D
setReflectionCoefficient
in class AudioEngine3D
coefficient
- applied to amplitude of reverbation added at each
iteration of reverb processing.AuralAttributes.setReflectionCoefficient(float)
public void setReverbDelay(float reverbDelay)
AudioEngine3D
setReverbDelay
in interface AudioDevice3D
setReverbDelay
in class AudioEngine3D
reverbDelay
- amount of time in millisecond between each
iteration of reverb processing.AuralAttributes.setReverbDelay(float reverbDelay)
public void setReverbOrder(int reverbOrder)
AudioEngine3D
setReverbOrder
in interface AudioDevice3D
setReverbOrder
in class AudioEngine3D
reverbOrder
- number of times reverb process loop is iterated.AuralAttributes.setReverbOrder(int)
public int startSample(int index)
AudioEngine3D
startSample
in interface AudioDevice3D
startSample
in class AudioEngine3D
index
- device specific reference number to device driver samplepublic int stopSample(int index)
AudioEngine3D
stopSample
in interface AudioDevice3D
stopSample
in class AudioEngine3D
index
- device specific reference number to device driver samplepublic void pauseSample(int index)
AudioEngine3D
pauseSample
in interface AudioDevice3D
pauseSample
in class AudioEngine3D
index
- device specific reference number to device driver samplepublic void unpauseSample(int index)
AudioEngine3D
unpauseSample
in interface AudioDevice3D
unpauseSample
in class AudioEngine3D
index
- device specific reference number to device driver samplepublic void updateSample(int index)
AudioEngine3D
updateSample
in interface AudioDevice3D
updateSample
in class AudioEngine3D
index
- device specific reference number to device driver samplepublic void muteSample(int index)
AudioEngine3D
muteSample
in interface AudioDevice3D
muteSample
in class AudioEngine3D
index
- device specific reference number to device driver samplepublic void unmuteSample(int index)
AudioEngine3D
unmuteSample
in interface AudioDevice3D
unmuteSample
in class AudioEngine3D
index
- device specific reference number to device driver samplepublic long getSampleDuration(int index)
AudioEngine3D
getSampleDuration
in interface AudioDevice3D
getSampleDuration
in class AudioEngine3D
index
- device specific reference number to device driver samplepublic int getNumberOfChannelsUsed(int index)
AudioEngine3D
getNumberOfChannelsUsed
in interface AudioDevice3D
getNumberOfChannelsUsed
in class AudioEngine3D
index
- device specific reference number to device driver samplepublic int getNumberOfChannelsUsed(int index, boolean muted)
getNumberOfChannelsUsed
in interface AudioDevice3D
getNumberOfChannelsUsed
in class AudioEngine3D
index
- device specific reference number to device driver samplemuted
- 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 long getStartTime(int index)
AudioEngine3D
getStartTime
in interface AudioDevice3D
getStartTime
in class AudioEngine3D
index
- device specific reference number to device driver samplepublic void setLoop(int index, int count)
AudioEngine3D
setLoop
in interface AudioDevice3D
setLoop
in class AudioEngine3D
index
- device specific reference number to device driver samplecount
- number of times sample is repeatedSound.setLoop(int)
public void setGain(float scaleFactor)
AudioEngine3DL2
setGain
in interface AudioDevice3DL2
setGain
in class AudioEngine3DL2
scaleFactor
- scale factor applied to calculated amplitudes for
all sounds playing on this devicepublic void setRateScaleFactor(int index, float rateScaleFactor)
AudioEngine3DL2
setRateScaleFactor
in interface AudioDevice3DL2
setRateScaleFactor
in class AudioEngine3DL2
index
- device specific reference to device driver samplerateScaleFactor
- non-negative factor applied to calculated
amplitudes for all sounds playing on this deviceSound.setRateScaleFactor(float)
public void pause()
pause
in interface AudioDevice3DL2
pause
in class AudioEngine3DL2
public void resume()
resume
in interface AudioDevice3DL2
resume
in class AudioEngine3DL2
Copyright © 2016–2022 SciJava. All rights reserved.