Skip to content

Latest commit

 

History

History
125 lines (100 loc) · 5.62 KB

nf-spatialaudioclient-ispatialaudioobject-setposition.md

File metadata and controls

125 lines (100 loc) · 5.62 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:spatialaudioclient.ISpatialAudioObject.SetPosition
ISpatialAudioObject::SetPosition (spatialaudioclient.h)
Sets the position in 3D space, relative to the listener, from which the ISpatialAudioObject audio data will be rendered.
ISpatialAudioObject interface [Core Audio]
SetPosition method
ISpatialAudioObject.SetPosition
ISpatialAudioObject::SetPosition
SetPosition
SetPosition method [Core Audio]
SetPosition method [Core Audio]
ISpatialAudioObject interface
coreaudio.ispatialaudioobject_setposition
spatialaudioclient/ISpatialAudioObject::SetPosition
coreaudio\ispatialaudioobject_setposition.htm
CoreAudio
DDF4859E-6510-45D5-82E7-2C5A7F2EC679
12/05/2018
ISpatialAudioObject interface [Core Audio],SetPosition method, ISpatialAudioObject.SetPosition, ISpatialAudioObject::SetPosition, SetPosition, SetPosition method [Core Audio], SetPosition method [Core Audio],ISpatialAudioObject interface, coreaudio.ispatialaudioobject_setposition, spatialaudioclient/ISpatialAudioObject::SetPosition
spatialaudioclient.h
Windows
Windows
19H1
ISpatialAudioObject::SetPosition
spatialaudioclient/ISpatialAudioObject::SetPosition
c++
APIRef
kbSyntax
COM
spatialaudioclient.h
ISpatialAudioObject.SetPosition

ISpatialAudioObject::SetPosition

-description

Sets the position in 3D space, relative to the listener, from which the ISpatialAudioObject audio data will be rendered.

-parameters

-param x [in]

The x position of the audio object, in meters, relative to the listener. Positive values are to the right of the listener and negative values are to the left.

-param y [in]

The y position of the audio object, in meters, relative to the listener. Positive values are above the listener and negative values are below.

-param z [in]

The z position of the audio object, in meters, relative to the listener. Positive values are behind the listener and negative values are in front.

-returns

If the method succeeds, it returns S_OK. If it fails, possible return codes include, but are not limited to, the values shown in the following table.

Return code Description
SPTLAUDCLNT_E_OUT_OF_ORDER

ISpatialAudioObjectRenderStreamBase::BeginUpdatingAudioObjects was not called before the call to SetPosition.

SPTLAUDCLNT_E_RESOURCES_INVALIDATED

SetEndOfStream was called either explicitly or implicitly in a previous audio processing pass. SetEndOfStream is called implicitly by the system if GetBuffer is not called within an audio processing pass (between calls to ISpatialAudioObjectRenderStreamBase::BeginUpdatingAudioObjects and ISpatialAudioObjectRenderStreamBase::EndUpdatingAudioObjects).

SPTLAUDCLNT_E_PROPERTY_NOT_SUPPORTED
The ISpatialAudioObject is not of type AudioObjectType_Dynamic. Set the type of the audio object with the type parameter to the ISpatialAudioObjectRenderStreamBase::ActivateSpatialAudioObject method.

-remarks

This method can only be called on a ISpatialAudioObject that is of type AudioObjectType_Dynamic. Set the type of the audio object with the type parameter to the ISpatialAudioObjectRenderStreamBase::ActivateSpatialAudioObject method.

Position values use a right-handed Cartesian coordinate system, where each unit represents 1 meter. The coordinate system is relative to the listener where the origin (x=0.0, y=0.0, z=0.0) represents the center point between the listener's ears.

If SetPosition is never called, the origin (x=0.0, y=0.0, z=0.0) is used as the default position. After SetPosition is called, the position that is set will be used for the audio object until the position is changed with another call to SetPosition.

-see-also

ISpatialAudioObject