提交 5ce389db authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-9958: [freeswitch-core,mod_local_stream] Add agc object and use it in mod_local_stream

上级 c07ad8c2
...@@ -1404,7 +1404,7 @@ SWITCH_STANDARD_API(local_stream_function) ...@@ -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); stream->write_function(stream, "-ERR invalid auto-volume level for stream: %s\n", source->name);
} else { } else {
if (!source->agc) { 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 { } else {
switch_agc_set_energy_avg(source->agc, source->energy_avg); switch_agc_set_energy_avg(source->agc, source->energy_avg);
switch_agc_set_energy_low(source->agc, source->energy_low); switch_agc_set_energy_low(source->agc, source->energy_low);
...@@ -1413,6 +1413,9 @@ SWITCH_STANDARD_API(local_stream_function) ...@@ -1413,6 +1413,9 @@ SWITCH_STANDARD_API(local_stream_function)
} else { } else {
source->vol = atoi(argv[2]); source->vol = atoi(argv[2]);
switch_normalize_volume_granular(source->vol); switch_normalize_volume_granular(source->vol);
if (source->agc) {
switch_agc_destroy(&source->agc);
}
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论