Package com.sun.j3d.audioengines
Class AudioEngine
- java.lang.Object
-
- com.sun.j3d.audioengines.AudioEngine
-
- All Implemented Interfaces:
AudioDevice
- Direct Known Subclasses:
AudioEngine3D
public abstract class AudioEngine extends java.lang.Object implements AudioDevice
The AudioEngine Class defines an audio output device that generates sound 'image' from scene graph. An AudioEngine object encapsulates the AudioDevice's basic information.NOTE: AudioEngine developers should not subclass this class directly. Subclass AudioEngine3DL2 instead.
-
-
Field Summary
-
Fields inherited from interface javax.media.j3d.AudioDevice
HEADPHONES, MONO_SPEAKER, STEREO_SPEAKERS
-
-
Constructor Summary
Constructors Constructor Description AudioEngine(PhysicalEnvironment physicalEnvironment)
Construct a new AudioEngine with the specified P.E.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract boolean
close()
Code to close the devicefloat
getAngleOffsetToSpeaker()
Get Angle Offset To Speaker returns value set as angle between vector to speaker and Z head axisint
getAudioPlaybackType()
Get Type of Audio Playback Output Device returns audio playback type to which sound is currently outputfloat
getCenterEarToSpeaker()
Get Distance from Ear to Speaker returns value set as distance from listener's ear to speakerint
getChannelsAvailable()
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 classint
getTotalChannels()
Query total number of channels available for sound rendering for this audio device.abstract boolean
initialize()
Code to initialize the devicevoid
setAngleOffsetToSpeaker(float angle)
Set Angle Offset To Speakervoid
setAudioPlaybackType(int type)
Set Type of Audio Playback physical transducer(s) sound is output to.void
setCenterEarToSpeaker(float distance)
Set Distance from the Center Ear to a Speaker
-
-
-
Constructor Detail
-
AudioEngine
public AudioEngine(PhysicalEnvironment physicalEnvironment)
Construct a new AudioEngine with the specified P.E.- Parameters:
physicalEnvironment
- the physical environment object where we want access to this device.
-
-
Method Detail
-
initialize
public abstract boolean initialize()
Code to initialize the device- Specified by:
initialize
in interfaceAudioDevice
- Returns:
- flag: true is initialized sucessfully, false if error
-
close
public abstract boolean close()
Code to close the device- Specified by:
close
in interfaceAudioDevice
- Returns:
- flag: true is closed sucessfully, false if error
-
setAudioPlaybackType
public void setAudioPlaybackType(int type)
Set Type of Audio Playback physical transducer(s) sound is output to. Valid types are HEADPHONE, MONO_SPEAKER, STEREO_SPEAKERS- Specified by:
setAudioPlaybackType
in interfaceAudioDevice
- Parameters:
type
- of audio output device
-
getAudioPlaybackType
public int getAudioPlaybackType()
Get Type of Audio Playback Output Device returns audio playback type to which sound is currently output- Specified by:
getAudioPlaybackType
in interfaceAudioDevice
- Returns:
- audio playback type
-
setCenterEarToSpeaker
public void setCenterEarToSpeaker(float distance)
Set Distance from the Center Ear to a Speaker- Specified by:
setCenterEarToSpeaker
in interfaceAudioDevice
- Parameters:
distance
- from the center ear and to the speaker
-
getCenterEarToSpeaker
public float getCenterEarToSpeaker()
Get Distance from Ear to Speaker returns value set as distance from listener's ear to speaker- Specified by:
getCenterEarToSpeaker
in interfaceAudioDevice
- Returns:
- distance from interaural midpoint between the ears to closest speaker
-
setAngleOffsetToSpeaker
public void setAngleOffsetToSpeaker(float angle)
Set Angle Offset To Speaker- Specified by:
setAngleOffsetToSpeaker
in interfaceAudioDevice
- Parameters:
angle
- in radian between head coordinate Z axis and vector to speaker
-
getAngleOffsetToSpeaker
public float getAngleOffsetToSpeaker()
Get Angle Offset To Speaker returns value set as angle between vector to speaker and Z head axis- Specified by:
getAngleOffsetToSpeaker
in interfaceAudioDevice
- Returns:
- angle in radians from head Z axis and vector from center ear to speaker
-
getTotalChannels
public int getTotalChannels()
Query total number of channels available for sound rendering for this audio device. returns number of maximum sound channels you can run with this library/device-driver.- Specified by:
getTotalChannels
in interfaceAudioDevice
- Returns:
- total number of channels that can be used for this audio device
-
getChannelsAvailable
public int getChannelsAvailable()
Query number of channels currently available for use by the returns number of sound channels currently available (number not being used by active sounds.- Specified by:
getChannelsAvailable
in interfaceAudioDevice
- Returns:
- total number of channels current available
-
getChannelsUsedForSound
public int getChannelsUsedForSound(Sound sound)
Deprecated.This method is now part of the Sound classQuery number of channels that would be used to render a particular sound node.- Specified by:
getChannelsUsedForSound
in interfaceAudioDevice
- Parameters:
sound
- refenence to sound node that query to be performed on returns number of sound channels used by a specific Sound node- Returns:
- number of channels a particular Sound node is using or would used if enabled and activated (rendered).
-
-