IAcousticEchoCancellationControl::SetEchoCancellationRenderEndpoint メソッド (audioclient.h)

音響エコー キャンセル (AEC) の参照ストリームとして使用するオーディオ レンダリング エンドポイントを設定します。

構文

HRESULT SetEchoCancellationRenderEndpoint(
  LPCWSTR endpointId
);

パラメーター

endpointId

AEC の参照ストリームとして使用する必要があるエンダー エンドポイントのエンドポイント ID。 無効なレンダリング デバイス ID を設定すると、E_INVALIDARGで失敗します。 値を NULL に設定すると、Windows は独自のアルゴリズムを使用してループバック参照デバイスを選択します

戻り値

次を含む HRESULT 値を返します。

説明
S_OK 正常終了しました。
E_INVALIDARG endpointId 値が無効です。

注釈

次の例は、 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
Header audioclient.h