public class AutomaticGainControl extends Object implements SpeechProcessor
The AGC amplifies/attenuates audio samples to maintain a configured peak amplitude, in dBFS (decibels full-scale). The gain controller is implemented by the native webrtc framework and modifies the audio buffer in place.
This pipeline component supports the following configuration properties:
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_COMPRESSION_GAIN_DB
default compression gain, in dB.
|
static int |
DEFAULT_TARGET_LEVEL_DBFS
default target peak amplitude, in dBFS.
|
Constructor and Description |
---|
AutomaticGainControl(SpeechConfig config)
constructs a new AGC instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
destroys the unmanaged AGC instance.
|
void |
process(SpeechContext context,
ByteBuffer frame)
processes a frame of audio.
|
public static final int DEFAULT_TARGET_LEVEL_DBFS
public static final int DEFAULT_COMPRESSION_GAIN_DB
public AutomaticGainControl(SpeechConfig config)
config
- the pipeline configuration instancepublic void close()
close
in interface AutoCloseable
public void process(SpeechContext context, ByteBuffer frame)
process
in interface SpeechProcessor
context
- the current speech contextframe
- the audio frame to detectCopyright © 2020. All rights reserved.