Gets a buffer that is used to supply the audio data for the ISpatialAudioObjectForHrtf.
HRESULT GetBuffer( [out] BYTE **buffer, [out] UINT32 *bufferLength );
The buffer into which audio data is written.
The length of the buffer in bytes. This length will be the value returned in the frameCountPerBuffer parameter to ISpatialAudioObjectRenderStreamForHrtf::BeginUpdatingAudioObjects multiplied by the value of the nBlockAlign field of the WAVEFORMATEX structure passed in the SpatialAudioHrtfActivationParams parameter to ISpatialAudioClient::ActivateSpatialAudioStream.
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.
ISpatialAudioObjectRenderStreamForHrtf::BeginUpdatingAudioObjects was not called before the call to GetBuffer. This method must be called before the first time GetBuffer is called and after every subsequent call to ISpatialAudioObjectRenderStreamForHrtf::EndUpdatingAudioObjects.
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).
The first time GetBuffer is called after it is activated with a call ISpatialAudioObjectRenderStreamForHrtf::ActivateSpatialAudioObjectForHrtf, lifetime of the spatial audio object starts. To keep the spatial audio object alive after that, this GetBuffer must be called on every processing pass (between calls to ISpatialAudioObjectRenderStreamForHrtf::BeginUpdatingAudioObjects and ISpatialAudioObjectRenderStreamForHrtf::EndUpdatingAudioObjects). If GetBuffer is not called within an audio processing pass, SetEndOfStream is called implicitly on the audio object, and the audio object cannot be reused again without being reactivated by calling ActivateSpatialAudioObjectForHrtf again.
The pointers retrieved by GetBuffer should not be used after ISpatialAudioObjectRenderStreamForHrtf::EndUpdatingAudioObjects has been called.