共用方式為


IAcousticEchoCancellationControl 介面 (audioclient.h)

提供機制來判斷音訊擷取端點是否支援聲場回音取消 (AEC) ,如果是的話,可讓用戶端設定應該作為參考數據流使用的音頻轉譯端點。

繼承

IAcousticEchoCancellationControl 介面繼承自 IUnknown 介面。

方法

IAcousticEchoCancellationControl 介面具有這些方法。

 
IAcousticEchoCancellationControl::SetEchoCancellationRenderEndpoint

設定音訊轉譯端點,該端點應該作為聲場迴音取消的參考數據流, (AEC) 。

備註

下列範例說明 IAcousticEchoCancellationControl 介面的使用方式。 呼叫 IAudioClient::GetService,傳入 IAcousticEchoCancellationControl 介面的 IID。 如果成功,擷取端點支援控制 AEC 的回送參考端點。 請注意,端點可能支援 AEC,但可能不支援控制 AEC 的回送參考端點。 呼叫 SetEchoCancellationRenderEndpoint 以設定 AEC 的參考數據流。 如果 對 GetService 的呼叫因E_NOINTERFACE而失敗,則如果支援 ) ,則 AEC 對端點的影響 (不允許控制回送參考端點。

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));

}

規格需求

需求
最低支援的用戶端 Windows 組建 22621
標頭 audioclient.h