Microsoft DirectX 8.1 (C++)

IDirectSound3DListener8

The IDirectSound3DListener8 interface is used to retrieve and set parameters that describe a listener's position, orientation, and listening environment in 3-D space.

The interface can be obtained by calling the IDirectSoundBuffer8::QueryInterface method on a primary buffer created with the DSBCAPS_CTRL3D flag. Applications that use audiopaths can obtain the interface from the audiopath as in the following code example, where pAudiopath is an IDirectMusicAudioPath8 interface pointer.

IDirectSound3DListener8 *pListener;
 
pAudioPath->GetObjectInPath(0, DMUS_PATH_PRIMARY_BUFFER,
    0, GUID_All_Objects, 0, IID_IDirectSound3DListener,
    (void **)&pListener)));

In addition to the methods inherited from IUnknown, the IDirectSound3DListener8 interface exposes the following methods.

Batch parameters

Method Description
CommitDeferredSettings Commits any deferred settings made since the last call to this method.
GetAllParameters Retrieves the state of the 3-D world and listener.
SetAllParameters Sets all 3-D listener parameters from a given DS3DLISTENER structure that describes all aspects of the 3-D listener at a moment in time.

Distance factor

Method Description
GetDistanceFactor Retrieves the distance factor, which is the number of meters in a vector unit.
SetDistanceFactor Sets the distance factor, which is the number of meters in a vector unit.

Doppler factor

Method Description
GetDopplerFactor Retrieves the Doppler effect factor.
SetDopplerFactor Sets the Doppler effect factor.

Orientation

Method Description
GetOrientation Retrieves the listener's orientation in vectors: a front vector and a top vector.
SetOrientation Sets the listener's orientation in terms of two vectors: a front vector and a top vector.

Position

Method Description
GetPosition Retrieves the listener's position in distance units.
SetPosition Sets the listener's position, in distance units.

Rolloff factor

Method Description
GetRolloffFactor Retrieves the rolloff factor, which determines the rate of attenuation over distance.
SetRolloffFactor Sets the rolloff factor, which determines the rate of attenuation over distance.

Velocity

Method Description
GetVelocity Retrieves the listener's velocity.
SetVelocity Sets the listener's velocity.

The LPDIRECTSOUND3DLISTENER type is defined as a pointer to the IDirectSound3DListener interface:

typedef struct IDirectSound3DListener  *LPDIRECTSOUND3DLISTENER;

Requirements

  Header: Declared in dsound.h.