ISpatialAudioClient::ActivateSpatialAudioStream method
[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]
Activates and initializes spatial audio stream using one of the spatial audio stream activation structures.
Syntax
HRESULT ActivateSpatialAudioStream( [in] const PROPVARIANT *activationParams, [in] REFIID riid, [out] VOID **stream );
Parameters
- activationParams [in]
-
The structure defining the activation parameters for the spatial audio stream. The vt field should be set to VT_BLOB and the blob field should be populated with a SpatialAudioObjectRenderStreamActivationParams or a SpatialAudioObjectRenderStreamForMetadataActivationParams.
- riid [in]
-
The UUID of the spatial audio stream interface to activate.
- stream [out]
-
A pointer to the pointer which receives the activated spatial audio interface.
Return value
If the method succeeds, it returns S_OK.
Remarks
This method supports activation of the following spatial audio stream interfaces:
ISpatialAudioObjectRenderStream
ISpatialAudioObjectRenderStreamForMetadata
Examples
Microsoft::WRL::ComPtr<ISpatialAudioClient> spatialAudioClient; // Activate ISpatialAudioClient on the desired audio-device hr = defaultDevice->Activate(__uuidof(ISpatialAudioClient), CLSCTX_INPROC_SERVER, nullptr, (void**)&spatialAudioClient); hr = spatialAudioClient->IsAudioObjectFormatSupported(&format); // Create the event that will be used to signal the client for more data HANDLE bufferCompletionEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr); SpatialAudioObjectRenderStreamActivationParams streamParams; streamParams.ObjectFormat = &format; streamParams.StaticObjectTypeMask = ChannelMask_Stereo; streamParams.MinDynamicObjectCount = 0; streamParams.MaxDynamicObjectCount = 0; streamParams.Category = AudioCategory_SoundEffects; streamParams.EventHandle = bufferCompletionEvent; streamParams.NotifyObject = nullptr; PROPVARIANT activationParams; PropVariantInit(&activationParams); activationParams.vt = VT_BLOB; activationParams.blob.cbSize = sizeof(streamParams); activationParams.blob.pBlobData = reinterpret_cast<BYTE *>(&streamParams); Microsoft::WRL::ComPtr<ISpatialAudioObjectRenderStream> spatialAudioStream; hr = spatialAudioClient->ActivateSpatialAudioStream(&activationParams, __uuidof(spatialAudioStream), (void**)&spatialAudioStream);
Requirements
|
Header |
|
|---|
See also
- ISpatialAudioClient
- SpatialAudioObjectRenderStreamActivationParams
- SpatialAudioObjectRenderStreamForMetadataActivationParams