IAcousticEchoCancellationControl interface (audioclient.h)

Provides a mechanism for determining if an audio capture endpoint supports acoustic echo cancellation (AEC) and, if so, allows the client to set the audio render endpoint that should be used as the reference stream.

Inheritance

The IAcousticEchoCancellationControl interface inherits from the IUnknown interface.

Methods

The IAcousticEchoCancellationControl interface has these methods.

 
IAcousticEchoCancellationControl::SetEchoCancellationRenderEndpoint

Sets the audio render endpoint that should be used as the reference stream for acoustic echo cancellation (AEC).

Remarks

The following example illustrates the usage of IAcousticEchoCancellationControl interface. Call IAudioClient::GetService, passing in the IID for the IAcousticEchoCancellationControl interface. If it succeeds, the capture endpoint supports control of the loopback reference endpoint for AEC. Note that an endpoint may support AEC, but may not support control of loopback reference endpoint for AEC. Call SetEchoCancellationRenderEndpoint to set the reference stream for AEC. If the call to GetService fails with E_NOINTERFACE, then the AEC effect on the endpoint (if supported), does not allow control over the loopback reference endpoint.

wil::com_ptr_nothrow<IAudioClient> audioClient;

RETURN_IF_FAILED(device->Activate(_uuidof(IAudioClient), CLSCTX_INPROC_SERVER, nullptr, (void **)&audioClient));

// Call Initialize before calling GetService
// Implementation of IAudioClient::Initialize has been omitted from this sample for brevity.

RETURN_IF_FAILED(audioClient->Initialize(…));

// If the capture endpoint supports acoustic echo cancellation (AEC), pass it the endpoint id of the
// audio render endpoint that should be used as the reference stream. If the capture endpoint does not
// support AEC, the GetService call fails with E_NOINTERFACE, so errors from GetService are not
// treated as fatal.

wil::com_ptr_nothrow<IAcousticEchoCancellationControl> audioAcousticEchoCancellationControl;

if (SUCCEEDED(audioClient->GetService(IID_PPV_ARGS(&audioAcousticEchoCancellationControl))))
{

RETURN_IF_FAILED(audioAcousticEchoCancellationControl-> SetEchoCancellationRenderEndpoint(endpointIdOfReferenceAudioStream));

}

Requirements

Requirement Value
Minimum supported client Windows Build 22621
Header audioclient.h