|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
The AudioDevice object interface specifies an abstract input device that creators of Java3D class libraries would implement for a particular device. Java3D's uses several methods to interact with specific devices. Since all audio devices implement this consistent interface, the user could have a portable means of initialize, set particular audio device elements and query generic characteristics for any audio device.
Initialization
Audio Playback Type
Distance to Speaker
Angular Offset of Speakers
Device Driver Specific Data
Instantiating and Registering a New Device
The API for instantiating devices is site-specific, but it consists of a device object with a constructor and at least all of the methods specified in the AudioDevice interface.
Once instantiated, the browser or application must register the device with the Java3D sound scheduler by associating this device with a PhysicalEnvironment. The setAudioDevice method introduces new devices to the Java3D environment and the allAudioDevices method produces an enumeration that allows examining all available devices within a Java3D environment. See PhysicalEnvironment class for more details.
Field Summary | |
static int |
HEADPHONES
Choosing Headphones as the audio playback type specifies that the audio playback will be through stereo headphones. |
static int |
MONO_SPEAKER
Choosing a single near-field monoaural speaker as the audio playback type specifies that the audio playback will be through a single speaker some supplied distance away from the listener. |
static int |
STEREO_SPEAKERS
Choosing a two near-field stereo speakers as the audio playback type specifies that the audio playback will be through stereo speakers some supplied distance away from, and at some given angle to the listener. |
Method Summary | |
boolean |
close()
Code to close the device and release resources. |
float |
getAngleOffsetToSpeaker()
Get Angle Offset (in radians) To Speaker. |
int |
getAudioPlaybackType()
Get Type of Audio Playback Output Device. |
float |
getCenterEarToSpeaker()
Get Distance from interaural mid-point between Ears to a Speaker. |
int |
getChannelsAvailable()
Query number of channels currently available for use. |
int |
getChannelsUsedForSound(Sound node)
Query number of channels that are used, or would be used to render a particular sound node. |
int |
getTotalChannels()
Query total number of channels available for sound rendering for this audio device. |
boolean |
initialize()
Initialize the audio device. |
void |
setAngleOffsetToSpeaker(float angle)
Set Angle Offset (in radians) To Speaker. |
void |
setAudioPlaybackType(int type)
Set Type of Audio Playback physical transducer(s) sound is output to. |
void |
setCenterEarToSpeaker(float distance)
Set Distance from interaural mid-point between Ears to a Speaker. |
Field Detail |
public static final int HEADPHONES
public static final int MONO_SPEAKER
public static final int STEREO_SPEAKERS
Method Detail |
public boolean initialize()
public boolean close()
public void setAudioPlaybackType(int type)
type
- audio playback typepublic int getAudioPlaybackType()
public void setCenterEarToSpeaker(float distance)
distance
- from interaural midpoint between the ears to closest speakerpublic float getCenterEarToSpeaker()
public void setAngleOffsetToSpeaker(float angle)
angle
- in radians from head Z axis and vector from center ear to speakerpublic float getAngleOffsetToSpeaker()
public int getTotalChannels()
public int getChannelsAvailable()
public int getChannelsUsedForSound(Sound node)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |