ISpatialAudioObjectForHrtf::SetGain method

Sets the gain for the ISpatialAudioObjectForHrtf.

Syntax


HRESULT SetGain(
  [infloat gain
);

Parameters

gain [in]

The gain for the ISpatialAudioObjectForHrtf.

Return value

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 codeDescription
SPTLAUDCLNT_E_OUT_OF_ORDER

ISpatialAudioObjectRenderStreamForHrtf::BeginUpdatingAudioObjects was not called before the call to SetGain.

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 ISpatialAudioObjectRenderStreamForHrtf::BeginUpdatingAudioObjects and ISpatialAudioObjectRenderStreamForHrtf::EndUpdatingAudioObjects).

 

Remarks

This is valid only for spatial audio objects configured to use the SpatialAudioHrtfDistanceDecay_CustomDecay decay type. Set the decay type of an ISpatialAudioObjectForHrtf object by calling SetDistanceDecay. Set the default decay type for an all objects in an HRTF render stream by setting the DistanceDecay field of the SpatialAudioHrtfActivationParams passed into ISpatialAudioClient::ActivateSpatialAudioStream.

If SetGain is never called, the default value of 0.0 is used. After SetGain is called, the gain that is set will be used for the audio object until the gain is changed with another call to SetGain.

Requirements

Header

Spatialaudiohrtf.h

See also

ISpatialAudioObjectForHrtf

 

 

Show: