3D RSX  Contents  Interfaces  Data Structures  Previous  Next

3D RSX Concepts

The following topics explain the concepts behind the 3D RSX Developer's Kit. They discuss 3D audio rendering, explain the sound emitter model, describe 3D RSX's support for coordinate systems and units, and introduce you to the 3D RSX library interfaces for rendering 3D audio:


Audio Rendering

3D RSX's support for audio rendering follows a similar model to that used by high-level graphical rendering engines. A typical graphical 3D application describes a scene with objects and defines a view of the scene by specifying a camera. When components in the scene change, the application informs the rendering engine, and the application renders a new image from the defined camera's perspective.

Similarly, an application describes an audio scene with sound source objects called emitters and defines an audio view of the scene by specifying a listener. When the emitters change position or orientation, or when the listener moves, the application renders a new audio view from the listener's perspective.

3D RSX provides interfaces to define two types of listeners and two types of emitters: direct and streaming listeners and cached and streaming emitters.

A direct listener allows 3D RSX to output sound to a standard audio interface. A streaming listener provides access to processed buffers from 3D RSX. Both allow you to define a listener and control its position and orientation in the audio environment.

Cached emitters are file-based sound sources. Streaming emitters require buffers and let your application process real-time data. When you create an emitter, you assign it a specific sound, much like you would assign lighting and texture properties to a polygon. You bring sounds to life by controlling when they start and stop and by adjusting their volume and tone.

Like graphical objects, you place and orient sounds in 3D space. You can adjust other properties, such as the definition of ambient and directional sound regions to achieve the desired rendering effect.

When you finish defining listeners and emitters, the 3D RSX library can begin an audio rendering of the scene. For best results, keep the audio environment consistent with the graphical environment. When objects move, both the graphical and audio rendering engines need updating. Likewise when the view of the scene changes, the camera and listener position need updating.


Sound Emitter Model

3D RSX models an emitter in terms of two concentric elliptical regions. These two ellipses describe an ambient regionand an attenuation region. The shape of these ellipses can be adjusted to vary the directionality of the emitter. Figure 1 shows the elliptical sound model.

The inner ellipse, identified by a minimum front range and minimum back range, defines an ambient region. The ambient region maintains a constant, maximum intensity relative to the given sound. The outer ellipse, identified by the maximum front range and maximum back range, defines the attenuation region. Within this region, audio is localized, and the intensity decreases logarithmically. Beyond the outer ellipse, the intensity is zero.


Figure 1. Elliptical Sound Model

NOTE. The 2D sound emitter model description represents a simplification of the 3D elliptical model. To envision the 3D sound emitter model, rotate the 2D model on its directional axis.

Figure 2 shows an emitter's attenuation as a function of its distance from the listener. The inner ellipse defines the ambient region. The sound intensity in the ambient region is a constant maximum value. The outer ellipse, defines the limit of the attenuation region.

The sound intensity in the attenuation region drops from the maximum value, which occurs along the border of the ambient region, to -20dB at the border of the attenuation region. Beyond the outer ellipse, the attenuation is infinite, yielding an intensity of zero.

Figure 2. Attenuation versus Distance


Audio Streaming

3D RSX provides streaming support for the listener and emitters. When you create an interface for a streaming listener or emitter, you must use the standard WAVEFORMATEX structure to specify a buffer format and approximate size.

About Audio Streaming

3D RSX's streaming interfaces are designed to work with a paced output device. A paced output device consumes data at a fixed rate. An audio wave device is considered a paced output device because it consumes audio buffers at the constant sampling rate for the audio codec. The usage model for these devices requires synchronization between the application and the driver. In the output model, the application is the data producer and the driver is the data consumer.

Using the Windows Wave API, synchronization is performed by the driver when it indicates the completion of a submitted buffer (this is the pacing mechanism for the wave driver). The application is responsible for submitting the next buffer, to keep the driver filled with data. Since an arbitrary number of buffers may be submitted to the wave driver, the application can implement various buffering schemes such as double buffering. To connect a streaming listener to the Wave API, the buffer callback from the wave driver should be answered with a streaming listener's RequestBuffer.

Alternatively, some devices may synchronize the application by blocking the application when a buffer is submitted. In this model, the application continuously writes buffers, relying on the driver to pace it by blocking during a write operation. The application can continuously call the streaming listener's RequestBufffer followed by a write operation to the device. Because the device blocks on the write operation, calls to RequestBuffer are paced by the consumption rate of the output device.

Since both of these pacing models are commonly used, the 3D RSX streaming interfaces provide non-blocking interfaces. This enables your application to easily fit into the pacing model of a particular device without any synchronization conflicts from 3D RSX.

Supported Audio Formats

3D RSX does not limit buffer formats to PCM (Pulse Code Modulation). You can use any ACM (Audio Compression Manager) resolvable format. Common drivers such as, Microsoft CCITT G.711, Microsoft IMA ADPCM, MS-ADPCM, Microsoft GSM 6.10, or TrueSpeech, convert non-PCM to PCM formatted files.

The System Control panel on your PC shows you which drivers are available on your system. See the Windows Multimedia Programmer's Reference for more information about ACM and PCM formats. For optimal performance, select PCM audio files to avoid format conversion.

Streaming Example

Figure3 illustrates an example of 3D RSX in a streaming environment. In this example, a communications connection provides two streams of audio that require audio localization. The diagram also shows 3D RSX processing several cached audio files. 3D RSX assigns each stream a streaming emitter, and the local cached audio files receive a cached emitter.

The streaming audio buffers pass through a splitter which de-multiplexes the data so that all the data associated with a specific buffer travels along the same path. Before submitting audio buffers to a streaming emitter, the application can perform operations not supported by 3D RSX, such as voice decompression and wave table synthesis, on a per-buffer basis.

The application is responsible for providing a continuous flow of playback buffers. The application may submit any number of buffers at one time. 3D RSX plays these buffers in first-in first-out (FIFO) order. 3D RSX uses event signaling to indicate the completion of a buffer. After the application receives the signal, it is safe to reuse the buffer.

When 3D RSX receives the data, it performs its work, localizing, mixing, and adding audio effects. Next, 3D RSX sets the audio environment by adjusting the reverberation model and performs transaural filtering, if necessary, to make headphone output suitable for speakers. You can tell 3D RSX whether you want to use speakers or headphones by changing the registry values before running your application (see Appendix B) or by using the tray applet while your application is running (click the headphone icon on the task tray to access a dialog that lets you select the desired output device).

Figure 3. Typical Audio Streaming in a Shared Virtual World

The final 3D RSX audio processing step is to output the sound to a listener. The application has the opportunity to receive processed buffers from 3D RSX through the streaming listener interface, or to just allow 3D RSX to output to a standard audio driver with the direct listener.


Coordinate Systems and Units

3D RSX complements existing 3D graphics systems by supporting both right- and left-handed coordinate systems. The application simply informs 3D RSX which format to use.

The left-handed coordinate system can be presented in the following orientation with respect to the display: the XY plane is the screen, with X increasing to the right, Y increasing upward, and Z increasing into the screen. The right-handed coordinate system uses this same XY orientation, but specifies Z increasing away from the screen.

3D RSX defines all of its audio using an absolute coordinate system, typically known as world or scene coordinates to many graphics libraries. There is no support for specifying the position or orientation of one object relative to another object. When working with high-level graphics libraries, coordinates passed to 3D RSX should be in either world or scene coordinates. That is, you must specify an audio object's X,Y,Z coordinates.

3D RSX uses the relative relationship between objects, their position and attributes, for rendering. In this model, Distance has no units.

3D RSX uses the speed of sound for Doppler effects. 3D RSX uses time specified in seconds. You must supply the value for the Doppler effect in generic units per second.


Interfaces

Interfaces contain sets of related methods that make it easy to render 3D audio. The 3D RSX library consists of five interfaces and two abstract base classes. The abstract base classes group together the methods that are common to all emitters or all listeners. The emitters or listeners provide the abstract base class functionality through their respective interfaces.

For additional information, see Interfaces.


3D RSX  Contents  Interfaces  Data Structures  Previous  Next

Copyright ©1996, 1997 Intel Corporation. All rights reserved