Capture Buffer Effects

Two capture buffer effects are available as kernel mode implementations on Microsoft Windows XP Home Edition and Windows XP Professional and later operating systems.

  • Acoustic echo cancellation (AEC)
  • Noise suppression
These effects can be used only in conjunction with a FullDuplex object.

The CaptureBuffer constructor takes either a predefined buffer location in memory or a CaptureBufferDescription structure that contains a CaptureEffectDescription structure that describes desired effects.

For each CaptureEffectDescription structure, you must specify either the LocateInHardware property or the LocateInSoftware property. In most cases, specify LocateInSoftware. Buffer creation fails if the effect is not available in the specified location.

The effect is identified in the CaptureEffectDescription.GuidEffectsClass property. To obtain the Microsoft software implementation, specify DSoundHelper.CaptureEffectsMsAcousticEchoCancellation or DSoundHelper.CaptureEffectsMsNoiseSuppression. To use another implementation available in hardware or software, obtain the class and instance globally unique identifier (GUID) from the manufacturer.

After the buffer has been created, you can retrieve information about the effects by using the CaptureBuffer.GetEffectsStatus method.

AEC is primarily of interest for applications that use voice communication from one site to another. Without echo cancellation, the signal from a microphone at site A is output from the speakers at site B, picked up by the microphone at site B, and rebroadcast at site A, possibly resulting in a feedback loop. AEC overcomes this problem by monitoring the incoming signal, adjusting it to take the room environment into account, and then removing it from the outgoing signal.

AEC has the following limitations.

  • If the acoustic environment changes, the adaptive filter can take two seconds or more to adjust.
  • Any late reverberations occurring more than 128 milliseconds after the original signal are not removed from the outgoing signal.
  • Only one capture buffer at a time can use AEC.
  • AEC cannot be created if another application is capturing.

The effect objects are obtained from the capture buffer object by using CaptureBuffer.GetObjectInPath.

Use the CaptureAcousticEchoCancellationEffect object to set and retrieve AEC parameters on a capture buffer that contains the AEC effect. You can also enable noise fill, which is a means of preventing complete silence when there is no new data in the outgoing signal.

Noise suppression can be applied only if AEC is also enabled. The noise suppression capture effect removes constant background noise, such as fan noise. Use the CaptureNoiseSuppressEffect object to set and retrieve parameters.