AutomaticGainControl
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
public
class
AutomaticGainControl
extends AudioEffect
Automatic Gain Control (AGC).
Automatic Gain Control (AGC) is an audio pre-processor which automatically normalizes the
output of the captured signal by boosting or lowering input from the microphone to match a preset
level so that the output signal level is virtually constant.
AGC can be used by applications where the input signal dynamic range is not important but where
a constant strong capture level is desired.
An application creates a AutomaticGainControl object to instantiate and control an AGC
engine in the audio framework.
To attach the AutomaticGainControl to a particular AudioRecord
,
specify the audio session ID of this AudioRecord when creating the AutomaticGainControl.
The audio session is retrieved by calling
AudioRecord.getAudioSessionId()
on the AudioRecord instance.
On some devices, an AGC can be inserted by default in the capture path by the platform
according to the MediaRecorder.AudioSource
used. The application should
call AutomaticGainControl.getEnable() after creating the AGC to check the default AGC activation
state on a particular AudioRecord session.
See AudioEffect
class for more details on
controlling audio effects.
Summary
Public methods |
static
AutomaticGainControl
|
create(int audioSession)
Creates an AutomaticGainControl and attaches it to the AudioRecord on the audio
session specified.
|
static
boolean
|
isAvailable()
Checks if the device implements automatic gain control.
|
Inherited methods |
From class
android.media.audiofx.AudioEffect
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public methods
create
public static AutomaticGainControl create (int audioSession)
Creates an AutomaticGainControl and attaches it to the AudioRecord on the audio
session specified.
Parameters |
audioSession |
int : system wide unique audio session identifier. The AutomaticGainControl
will be applied to the AudioRecord with the same audio session. |
Returns |
AutomaticGainControl |
AutomaticGainControl created or null if the device does not implement AGC. |
isAvailable
public static boolean isAvailable ()
Checks if the device implements automatic gain control.
Returns |
boolean |
true if the device implements automatic gain control, false otherwise. |