All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface javax.media.j3d.AudioDevice

public interface AudioDevice
The AudioDevice Class defines an audio device and encapsulates the audio device's basic information and characteristics.

A Java3D application running on a particular machine could have one of several options available to it for playing the audio image created by the sound renderer. Perhaps the machine Java3D is executing on has more than one sound card (e.g., one that is a Wave Table Synthesis card and the other with accelerated sound spatialization hardware). Furthermore, suppose there are Java3D audio device drivers that execute Java3D audio methods on each of these specific cards. In such a case the application would have at least two audio device drivers through which the audio could be produced. For such a case the Java3D application must choose the audio device driver with which sound rendering is to be performed. Once this audio device is chosen, the application can additionally select the type of audio playback type the rendered sound image is to be output on. The playback device (headphones or speaker(s)) is physically connected to the port the selected device driver outputs to.

AudioDevice Interface

Instantiating and Registering a New Device


Variable Index

 o HEADPHONES
Headphones Specifies that the audio playback will be through stereo headphones.
 o MONO_SPEAKER
Single near-field monoaural speaker Specifies that the audio playback will be through a single speaker some distance away from the listener.
 o STEREO_SPEAKERS
Two near-field stereo speakers Specifies that the audio playback will be through stereo speakers some distance away from, and at some angle to the listener.

Method Index

 o close()
Code to close the device and release resources
 o getAngleOffsetToSpeaker()
Get Angle Offset (in radians) To Speaker
 o getAudioPlaybackType()
Get Type of Audio Playback Output Device
 o getCenterEarToSpeaker()
Get Distance from interaural mid-point between Ears to a Speaker
 o getChannelsAvailable()
Query number of channels currently available for use.
 o getChannelsUsedForSound(Sound)
Query number of channels that are used, or would be used to render a particular sound node.
 o getTotalChannels()
Query total number of channels available for sound rendering for this audio device.
 o initialize()
Initialize the audio device.
 o setAngleOffsetToSpeaker(float)
Set Angle Offset (in radians) To Speaker
 o setAudioPlaybackType(int)
Set Type of Audio Playback physical transducer(s) sound is output to.
 o setCenterEarToSpeaker(float)
Set Distance from interaural mid-point between Ears to a Speaker

Variables

 o HEADPHONES
 public static final int HEADPHONES
Headphones Specifies that the audio playback will be through stereo headphones.

 o MONO_SPEAKER
 public static final int MONO_SPEAKER
Single near-field monoaural speaker Specifies that the audio playback will be through a single speaker some distance away from the listener.

 o STEREO_SPEAKERS
 public static final int STEREO_SPEAKERS
Two near-field stereo speakers Specifies that the audio playback will be through stereo speakers some distance away from, and at some angle to the listener.

Methods

 o initialize
 public abstract boolean initialize()
Initialize the audio device. Exactly what occurs during initialization is implementation dependent. This method provides explicit control by the user over when this initialization occurs.

Returns:
true if initialization was sucessful without errors
 o close
 public abstract boolean close()
Code to close the device and release resources

Returns:
true if close of device was sucessful without errors
 o setAudioPlaybackType
 public abstract void setAudioPlaybackType(int type)
Set Type of Audio Playback physical transducer(s) sound is output to. Valid types are HEADPHONE, MONO_SPEAKER, STEREO_SPEAKERS

Parameters:
type - audio playback type
 o getAudioPlaybackType
 public abstract int getAudioPlaybackType()
Get Type of Audio Playback Output Device

Returns:
audio playback type
 o setCenterEarToSpeaker
 public abstract void setCenterEarToSpeaker(float distance)
Set Distance from interaural mid-point between Ears to a Speaker

Parameters:
distance - from interaural midpoint between the ears to closest speaker
 o getCenterEarToSpeaker
 public abstract float getCenterEarToSpeaker()
Get Distance from interaural mid-point between Ears to a Speaker

Returns:
distance from interaural midpoint between the ears to closest speaker
 o setAngleOffsetToSpeaker
 public abstract void setAngleOffsetToSpeaker(float angle)
Set Angle Offset (in radians) To Speaker

Parameters:
angle - in radians from head Z axis and vector from center ear to speaker
 o getAngleOffsetToSpeaker
 public abstract float getAngleOffsetToSpeaker()
Get Angle Offset (in radians) To Speaker

Returns:
angle in radians from head Z axis and vector from center ear to speaker
 o getTotalChannels
 public abstract int getTotalChannels()
Query total number of channels available for sound rendering for this audio device. This returns the maximum number of channels available for Java3D sound rendering for all sound sources.

Returns:
total number of channels that can be used for this audio device
 o getChannelsAvailable
 public abstract int getChannelsAvailable()
Query number of channels currently available for use. During rendering, when sound nodes are playing, this method returns the number of channels still available to Java3D for rendering additional sound nodes.

Returns:
total number of channels current available
 o getChannelsUsedForSound
 public abstract int getChannelsUsedForSound(Sound node)
Query number of channels that are used, or would be used to render a particular sound node. This method returns the number of channels needed to render a particular Sound node. The return value is the same no matter if the Sound is currently active and enabled (being played) or is inactive.

Returns:
number of channels a particular Sound node is using or would used if enabled and activated (rendered).

All Packages  Class Hierarchy  This Package  Previous  Next  Index