This function is only in Prosody version 1 (see also the conversion guide for further details).
int sm_adjust_agc_module_params(struct sm_adjust_agc_module_parms *agcp)
typedef struct sm_adjust_agc_module_parms {
tSMModuleId module; /* in */
enum kSMAGCType {
kSMAGCTypeRecord,
kSMAGCTypeReplay,
} agc_type; /* in */
double fp_params[4]; /* in */
} SM_ADJUST_AGC_MODULE_PARMS;
Adjust parameter for record/replay AGC.
Invoking the call allows application to change default behaviour of automatic gain control used with subsequent record and replay jobs (conferencing AGC unaffected) run for channels hosted on module module.
The parameter agc_type selects the type of AGC whose behaviour is being altered.
The elements of fp_params should be set up as follows:
| Element | Range |
|---|---|
| fp_params[kAdjustAGCFPParamIxMaxIncreseRate] | FP value 0.0...1.0 |
| fp_params[kAdjustAGCFPParamIxMaxDecreaseRate] | FP value 0.0...1.0 |
| fp_params[kAdjustAGCFPParamIxSensitivity] | FP value 0.0...1.0 |
The AGC algorithm analyses the speech signal, and makes decisions to either increase or decrease the gain applied. The aim is to provide a speech signal with an acceptable volume. If the signal is stationary (e.g. a tone) the resulting signal level will be 0dBm0. However, human speech has a rapidly changing power envelope, so this algorithm is designed to adjust the gain in a subjectively acceptable way. The parameters affect AGC as follows.
fp_params[AdjustAGCFPPParamIxSensitivity] controls the
sensitivity to a reduction in the input speech energy. The
algorithm always reacts immediately to an increase in input
energy. A value of zero will make the AGC react to every minute
change in intensity, a value of unity will result in no reaction
to reduction in input energy (i.e. the gain will never
increase). The AGC will react to a reduction in input signal
energy if the input energy changes by less than
fp_params[kAdjustAGCFPParamIxSensitivity] per 8ms.
Having "reacted" to the change in input energy, the gain is
updated at a rate of
fp_params[kAdjustAGCFPParamIxMaxIncreaseRate] per 8mS or
fp_params[kAdjustAGCFPParamIxMaxReduceRate] per 8mS as
appropriate.
The call may only be invoked when no channel is allocated on the given module (for example, immediately following f/w download to module).
0 if call completed successfully, otherwise a standard error such as:
This function is part of the Prosody speech processing API.