Java Doc for AudioDevice.java in  » 6.0-JDK-Modules » java-3d » javax » media » j3d » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » java 3d » javax.media.j3d 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.media.j3d.AudioDevice

All known Subclasses:   com.sun.j3d.audioengines.AudioEngine,  org.jdesktop.j3d.audioengines.joal.JOALMixer,
AudioDevice
public interface AudioDevice (Code)
The AudioDevice Class defines 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 selection of this device driver is done through methods in the PhysicalEnvironment object - see PhysicalEnvironment class. The application would query how many audio devices are available. For each device, the user can get the AudioDevice object that describes it and query its characteristics. Once a decision is made about which of the available audio devices to use for a PhysicalEnvironment, the particular device is set into this PhysicalEnvironment's fields. Each PhysicalEnvironment object may use only a single audio device.

    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

      Each audio device driver must be initialized. The chosen device driver should be initialized before any Java3D Sound methods are executed because the implementation of the Sound methods, in general, are potentially device driver dependent.

    Audio Playback Type

      These methods set and retrieve the audio playback type used to output the analog audio from rendering Java3D Sound nodes. The audio playback type specifies that playback will be through: stereo headphones, a monaural speaker, or a pair of speakers. For the stereo speakers, it is assumed that the two output speakers are equally distant from the listener, both at same angle from the head axis (thus oriented symmetrically about the listener), and at the same elevation. The type of playback chosen affects the sound image generated. Cross-talk cancellation is applied to the audio image if playback over stereo speakers is selected.

    Distance to Speaker

      These methods set and retrieve the distance in meters from the center ear (the midpoint between the left and right ears) and one of the speakers in the listener's environment. For monaural speaker playback, a typical distance from the listener to the speaker in a workstation cabinet is 0.76 meters. For stereo speakers placed at the sides of the display, this might be 0.82 meters.

    Angular Offset of Speakers

      These methods set and retrieve the angle in radians between the vectors from the center ear to each of the speaker transducers and the vectors from the center ear parallel to the head coordinate's Z axis. Speakers placed at the sides of the computer display typically range between 0.28 to 0.35 radians (between 10 and 20 degrees).

    Device Driver Specific Data

      While the sound image created for final output to the playback system is either only mono or stereo (for this version of Java3D) most device driver implementations will mix the left and right image signals generated for each rendered sound source before outputting the final playback image. Each sound source will use N input channels of this internal mixer. Each implemented Java3D audio device driver will have its own limitations and driver-specific characteristics. These include channel availability and usage (during rendering). Methods for querying these device-driver specific characteristics are provided.

Instantiating and Registering a New Device

    A browser or applications developer must instantiate whatever system- specific audio devices that he or she needs and that exist on the system. This device information typically exists in a site configuration file. The browser or application will instantiate the physical environment as requested by the end-user.

    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.

General Rules for calling AudioDevice methods: It is illegal for an application to call any non-query AudioDevice method if the AudioDevice is created then explicitly assigned to a PhysicalEnvironment using PhysicalEnvironment.setAudioDevice(); When either PhysicalEnvironment.setAudioDevice() is called - including when implicitly called by SimpleUniverse.getViewer().createAudioDevice() - the Core creates a SoundScheduler thread which makes calls to the AudioDevice.

If an application creates it's own instance of an AudioDevice and initializes it directly, rather than using PhysicalEnvironment. setAudioDevice(), that application may make any AudioDevice3D methods calls without fear of the Java 3D Core also trying to control the AudioDevice. Under this condition it is safe to call AudioDevice non-query methods.



Field Summary
final public static  intHEADPHONES
     Choosing Headphones as the audio playback type specifies that the audio playback will be through stereo headphones.
final public static  intMONO_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.
final public static  intSTEREO_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
abstract public  booleanclose()
     Code to close the device and release resources.
abstract public  floatgetAngleOffsetToSpeaker()
     Get Angle Offset (in radians) To Speaker.
abstract public  intgetAudioPlaybackType()
     Get Type of Audio Playback Output Device.
abstract public  floatgetCenterEarToSpeaker()
     Get Distance from interaural mid-point between Ears to a Speaker.
abstract public  intgetChannelsAvailable()
     Query number of channels currently available for use.
abstract public  intgetChannelsUsedForSound(Sound node)
     Query number of channels that are used, or would be used to render a particular sound node.
abstract public  intgetTotalChannels()
     Query total number of channels available for sound rendering for this audio device.
abstract public  booleaninitialize()
     Initialize the audio device.
abstract public  voidsetAngleOffsetToSpeaker(float angle)
     Set Angle Offset (in radians) To Speaker.
abstract public  voidsetAudioPlaybackType(int type)
     Set Type of Audio Playback physical transducer(s) sound is output to.
abstract public  voidsetCenterEarToSpeaker(float distance)
     Set Distance from interaural mid-point between Ears to a Speaker.

Field Detail
HEADPHONES
final public static int HEADPHONES(Code)
Choosing Headphones as the audio playback type specifies that the audio playback will be through stereo headphones.



MONO_SPEAKER
final public static int MONO_SPEAKER(Code)
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.



STEREO_SPEAKERS
final public static int STEREO_SPEAKERS(Code)
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 Detail
close
abstract public boolean close()(Code)
Code to close the device and release resources. true if close of device was successful without errors



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



getAudioPlaybackType
abstract public int getAudioPlaybackType()(Code)
Get Type of Audio Playback Output Device. audio playback type



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



getChannelsAvailable
abstract public int getChannelsAvailable()(Code)
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. total number of channels current available



getChannelsUsedForSound
abstract public int getChannelsUsedForSound(Sound node)(Code)
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. number of channels a particular Sound node is using or would usedif enabled and activated (rendered).



getTotalChannels
abstract public int getTotalChannels()(Code)
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. total number of channels that can be used for this audio device



initialize
abstract public boolean initialize()(Code)
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. Initialization must be initiated before any other AudioDevice methods are called. true if initialization was successful without errors



setAngleOffsetToSpeaker
abstract public void setAngleOffsetToSpeaker(float angle)(Code)
Set Angle Offset (in radians) To Speaker.
Parameters:
  angle - in radians from head Z axis and vector from center ear to speaker



setAudioPlaybackType
abstract public void setAudioPlaybackType(int type)(Code)
Set Type of Audio Playback physical transducer(s) sound is output to. Valid types are HEADPHONES, MONO_SPEAKER, STEREO_SPEAKERS
Parameters:
  type - audio playback type



setCenterEarToSpeaker
abstract public void setCenterEarToSpeaker(float distance)(Code)
Set Distance from interaural mid-point between Ears to a Speaker.
Parameters:
  distance - from interaural midpoint between the ears to closest speaker



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.