Documentation
¶
Overview ¶
Package apm provides Go bindings for the WebRTC Audio Processing Module (APM). It supports echo cancellation (AEC3), noise suppression, automatic gain control, and high-pass filtering. Audio must be 48kHz int16 PCM in 10ms frames (480 samples/channel).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APM ¶
type APM struct {
// contains filtered or unexported fields
}
func (*APM) ProcessCapture ¶
ProcessCapture processes a 10ms capture (microphone) frame in-place. samples must contain exactly 480 * numChannels int16 values.
func (*APM) ProcessRender ¶
ProcessRender processes a 10ms render (speaker/far-end) frame in-place. This feeds the echo canceller with the signal being played back. samples must contain exactly 480 * numChannels int16 values.
func (*APM) SetStreamDelayMs ¶
SetStreamDelayMs sets the delay in milliseconds between the far-end signal being rendered and arriving at the near-end microphone.
func (*APM) StreamDelayMs ¶
type APMConfig ¶
type APMConfig struct {
EchoCanceller bool
GainController bool
HighPassFilter bool
NoiseSuppressor bool
CaptureChannels int
RenderChannels int
}
func DefaultConfig ¶
func DefaultConfig() APMConfig
type Stats ¶
type Stats struct {
EchoReturnLoss float64 // ERL in dB (higher = more echo removed)
EchoReturnLossEnhancement float64 // ERLE in dB (higher = better cancellation)
DivergentFilterFraction float64 // 0-1, fraction of time filter is divergent
DelayMs int // Estimated echo path delay
ResidualEchoLikelihood float64 // 0-1, likelihood of residual echo
HasERL bool
HasERLE bool
HasDelay bool
HasResidualEcho bool
HasDivergent bool
}
Stats holds AEC statistics from the WebRTC APM.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package webrtc provides WebRTC audio processing module (APM) source compiled via CGo.
|
Package webrtc provides WebRTC audio processing module (APM) source compiled via CGo. |