Skip to content
Chuck Walbourn edited this page Oct 22, 2015 · 6 revisions

AudioListener is a helper object derived from X3DAUDIO_LISTENER used by SoundEffectInstance's / DynamicSoundEffectInstance Apply3D method.

See AudioEmitter.

Header

#include <Audio.h>

Initialization

The default constructor creates a listener located at 0,0,0 facing -z and an up vector of +y.

When using left-handed coordinates, be sure to set OrientFront

Helpers

In addition to setting the members of X3DAUDIO_LISTENER directly, these helper functions are provided:

  • SetPosition (XMVECTOR) or (XMFLOAT3): Sets the Position of the listener.

  • SetVelocity (XMVECTOR) or (XMFLOAT3): Sets the Velocity of the listener.

  • SetOrientation (XMVECTOR forward, XMVECTOR up) or (XMFLOAT3 forward, XMFLOAT3 up)

  • SetOrientationFromQuaternion (XMVECTOR): Sets the OrientFront/OrientTop of the listener.

  • Update (XMVECTOR newPos, XMVECTOR upDir, float dt ): Computes a direction and velocity for the listener based on the existing Position and the newPos, updating the OrientFront/OrientTop to match, and then setting the Position to the newPos. If dt is 0, the update is skipped.

Further reading

X3DAudio
X3DAudioCalculate

For Use

  • Universal Windows Platform apps
  • Windows 8.1 Store apps
  • Windows desktop apps
  • Windows 7 Service Pack 1
  • Windows Vista Service Pack 2 with KB971644
  • Windows phone 8.1
  • Xbox One

For Development

  • Visual Studio 2015
  • Visual Studio 2013
  • Xbox One XDK

Related Projects

DirectX Tool Kit for DirectX 12

DirectXMesh

DirectXTex

DirectXMath

Content Exporter

Win2D

Clone this wiki locally