FS-9958: [freeswitch-core,mod_local_stream] Add agc object and use it in mod_local_stream
This commit is contained in:
parent
c07ad8c263
commit
5ce389db05
|
@ -1404,7 +1404,7 @@ SWITCH_STANDARD_API(local_stream_function)
|
|||
stream->write_function(stream, "-ERR invalid auto-volume level for stream: %s\n", source->name);
|
||||
} else {
|
||||
if (!source->agc) {
|
||||
switch_agc_create(&source->agc, source->energy_avg, source->energy_low, 500, 3, (1000 / source->interval) * 2);
|
||||
switch_agc_create(&source->agc, source->energy_avg, source->energy_low, 10, 3, (1000 / source->interval) * 2);
|
||||
} else {
|
||||
switch_agc_set_energy_avg(source->agc, source->energy_avg);
|
||||
switch_agc_set_energy_low(source->agc, source->energy_low);
|
||||
|
@ -1413,6 +1413,9 @@ SWITCH_STANDARD_API(local_stream_function)
|
|||
} else {
|
||||
source->vol = atoi(argv[2]);
|
||||
switch_normalize_volume_granular(source->vol);
|
||||
if (source->agc) {
|
||||
switch_agc_destroy(&source->agc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue