Share via


IAcousticEchoCancellationControl-Schnittstelle (audioclient.h)

Stellt einen Mechanismus bereit, um zu bestimmen, ob ein Audioaufnahmeendpunkt AEC (Acoustic Echo Cancellation, AEC) unterstützt, und ermöglicht es dem Client, den Audiorenderenderendpunkt festzulegen, der als Referenzdatenstrom verwendet werden soll.

Vererbung

Die IAcousticEchoCancellationControl-Schnittstelle erbt von der IUnknown-Schnittstelle.

Methoden

Die IAcousticEchoCancellationControl-Schnittstelle verfügt über diese Methoden.

 
IAcousticEchoCancellationControl::SetEchoCancellationRenderEndpoint

Legt den Audiorenderingendpunkt fest, der als Referenzdatenstrom für die akustische Echounterdrückung (Acoustic Echo Cancellation, AEC) verwendet werden soll.

Hinweise

Das folgende Beispiel veranschaulicht die Verwendung der IAcousticEchoCancellationControl-Schnittstelle . Rufen Sie IAudioClient::GetService auf, und übergeben Sie die IID für die IAcousticEchoCancellationControl-Schnittstelle . Wenn dies erfolgreich ist, unterstützt der Erfassungsendpunkt die Steuerung des Loopbackverweisendpunkts für AEC. Beachten Sie, dass ein Endpunkt möglicherweise AEC unterstützt, die Steuerung des Loopbackverweisendpunkts für AEC jedoch nicht unterstützt. Rufen Sie SetEchoCancellationRenderEndpoint auf, um den Verweisstream für AEC festzulegen. Wenn der Aufruf von GetService mit E_NOINTERFACE fehlschlägt, lässt der AEC-Effekt auf den Endpunkt (sofern unterstützt) keine Kontrolle über den Loopbackverweisendpunkt zu.

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

}

Anforderungen

Anforderung Wert
Unterstützte Mindestversion (Client) Windows Build 22621
Kopfzeile audioclient.h