Antarmuka IAcousticEchoCancellationControl (audioclient.h)

Menyediakan mekanisme untuk menentukan apakah titik akhir tangkapan audio mendukung pembatalan gema akustik (AEC) dan, jika demikian, memungkinkan klien untuk mengatur titik akhir render audio yang harus digunakan sebagai aliran referensi.

Warisan

Antarmuka IAcousticEchoCancellationControl mewarisi dari antarmuka IUnknown.

Metode

Antarmuka IAcousticEchoCancellationControl memiliki metode ini.

 
IAcousticEchoCancellationControl::SetEchoCancellationRenderEndpoint

Mengatur titik akhir render audio yang harus digunakan sebagai aliran referensi untuk pembatalan gema akustik (AEC).

Keterangan

Contoh berikut mengilustrasikan penggunaan antarmuka IAcousticEchoCancellationControl . Panggil IAudioClient::GetService, melewati IID untuk antarmuka IAcousticEchoCancellationControl . Jika berhasil, titik akhir pengambilan mendukung kontrol titik akhir referensi loopback untuk AEC. Perhatikan bahwa titik akhir dapat mendukung AEC, tetapi mungkin tidak mendukung kontrol titik akhir referensi loopback untuk AEC. Panggil SetEchoCancellationRenderEndpoint untuk mengatur aliran referensi untuk AEC. Jika panggilan ke GetService gagal dengan E_NOINTERFACE, efek AEC pada titik akhir (jika didukung), tidak mengizinkan kontrol atas titik akhir referensi loopback.

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

}

Persyaratan

Persyaratan Nilai
Klien minimum yang didukung Windows Build 22621
Header audioclient.h