Platform SDK: DirectX

Buffer Position and Velocity

[C++]

An application can set and retrieve a sound source's position in 3-D space by using the IDirectSound3DBuffer::SetPosition and IDirectSound3DBuffer::GetPosition methods. A position is expressed as a vector, relative to either world space or the listener, depending on the processing mode.

To set or retrieve the velocity value that DirectSound uses to calculate Doppler-shift effects for a listener, you use the IDirectSound3DBuffer::SetVelocity and IDirectSound3DBuffer::GetVelocity methods. Velocity is measured in distance units per second—by default, meters per second.

[Visual Basic]

An application can set and retrieve a sound source's position in 3-D space by using the DirectSound3DBuffer.SetPosition and DirectSound3DBuffer.GetPosition methods. A position is expressed as a vector, relative to either world space or the listener, depending on the processing mode.

To set or retrieve the velocity value that DirectSound uses to calculate Doppler-shift effects for a listener, you use the DirectSound3DBuffer.SetVelocity and DirectSound3DBuffer.GetVelocity methods. Velocity is measured in distance units per second—by default, meters per second.

Note that velocity is completely independent of the actual position or movement of a buffer. It is entirely up to the application to set the appropriate velocity for a buffer.