Package com.sun.j3d.audioengines
Class AudioEngine
java.lang.Object
com.sun.j3d.audioengines.AudioEngine
- All Implemented Interfaces:
AudioDevice
- Direct Known Subclasses:
AudioEngine3D
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
ConstructorsConstructorDescriptionAudioEngine(PhysicalEnvironment physicalEnvironment) Construct a new AudioEngine with the specified P.E. -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanclose()Code to close the devicefloatGet Angle Offset To Speaker returns value set as angle between vector to speaker and Z head axisintGet Type of Audio Playback Output Device returns audio playback type to which sound is currently outputfloatGet Distance from Ear to Speaker returns value set as distance from listener's ear to speakerintQuery number of channels currently available for use by the returns number of sound channels currently available (number not being used by active sounds.intgetChannelsUsedForSound(Sound sound) Deprecated.This method is now part of the Sound classintQuery total number of channels available for sound rendering for this audio device.abstract booleanCode to initialize the devicevoidsetAngleOffsetToSpeaker(float angle) Set Angle Offset To SpeakervoidsetAudioPlaybackType(int type) Set Type of Audio Playback physical transducer(s) sound is output to.voidsetCenterEarToSpeaker(float distance) Set Distance from the Center Ear to a Speaker
-
Constructor Details
-
AudioEngine
Construct a new AudioEngine with the specified P.E.- Parameters:
physicalEnvironment- the physical environment object where we want access to this device.
-
-
Method Details
-
initialize
public abstract boolean initialize()Code to initialize the device- Specified by:
initializein interfaceAudioDevice- Returns:
- flag: true is initialized sucessfully, false if error
-
close
public abstract boolean close()Code to close the device- Specified by:
closein 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:
setAudioPlaybackTypein 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:
getAudioPlaybackTypein interfaceAudioDevice- Returns:
- audio playback type
-
setCenterEarToSpeaker
public void setCenterEarToSpeaker(float distance) Set Distance from the Center Ear to a Speaker- Specified by:
setCenterEarToSpeakerin 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:
getCenterEarToSpeakerin 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:
setAngleOffsetToSpeakerin 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:
getAngleOffsetToSpeakerin 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:
getTotalChannelsin 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:
getChannelsAvailablein interfaceAudioDevice- Returns:
- total number of channels current available
-
getChannelsUsedForSound
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:
getChannelsUsedForSoundin 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).
-