Integration with Direct3D

The IDirectSound3DBuffer and IDirectSound3DListener interfaces are designed to work together with Direct3DŽ. The positioning information used by Direct3D to arrange objects in a virtual environment can also be used to arrange sound sources. The D3DVECTOR and D3DVALUE types that are familiar to Direct3D programmers are also used in the IDirectSound3DBuffer and IDirectSound3DListener interfaces. The same left-handed coordinate system used by Direct3D is employed by DirectSound. (For information about coordinate systems, see 3-D Coordinate Systems, in the Direct3D overview material.)

You can use the system callback mechanism of Direct3D to simplify the implementation of 3-D sound in your application. For example, you could use the D3DRMFRAMEMOVECALLBACK application-defined function to monitor the movement of a frame in an application and change the sonic environment only when a certain condition has been reached.

In DirectSound, distances are normally measured in meters. If your application does not use the meter as its unit of measure for 3-D graphics, you can set a distance factor, which is a floating-point value representing meters per application-specified distance unit. For example, if your application uses feet, it could specify a DirectSound distance factor of .3048, which is the number of meters in a foot.