Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
bfe1a84c
提交
bfe1a84c
authored
5月 03, 2017
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-9922: [mod_conference] Auto Energy Level
上级
a0d0dc2d
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
16 行增加
和
6 行删除
+16
-6
mod_local_stream.c
src/mod/formats/mod_local_stream/mod_local_stream.c
+1
-1
switch_resample.c
src/switch_resample.c
+15
-5
没有找到文件。
src/mod/formats/mod_local_stream/mod_local_stream.c
浏览文件 @
bfe1a84c
...
...
@@ -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
,
1
0
,
3
,
(
1000
/
source
->
interval
)
*
2
);
switch_agc_create
(
&
source
->
agc
,
source
->
energy_avg
,
source
->
energy_low
,
50
0
,
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
);
...
...
src/switch_resample.c
浏览文件 @
bfe1a84c
...
...
@@ -513,15 +513,23 @@ SWITCH_DECLARE(switch_status_t) switch_agc_feed(switch_agc_t *agc, int16_t *data
agc
->
score_count
=
0
;
agc
->
score_sum
=
0
;
if
(
agc
->
score_avg
>
agc
->
energy_avg
+
agc
->
margin
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG1
,
"[%s] OVER++ SCORE AVG: %d ENERGY AVG: %d MARGIN: %d
\n
"
,
agc
->
token
,
agc
->
score_avg
,
agc
->
energy_avg
,
agc
->
margin
);
agc
->
score_over
++
;
if
(
agc
->
score_avg
>
agc
->
energy_avg
)
{
if
(
agc
->
score_avg
-
agc
->
energy_avg
>
agc
->
margin
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG1
,
"[%s] OVER++ SCORE AVG: %d ENERGY AVG: %d MARGIN: %d
\n
"
,
agc
->
token
,
agc
->
score_avg
,
agc
->
energy_avg
,
agc
->
margin
);
agc
->
score_over
++
;
}
}
else
{
agc
->
score_over
=
0
;
}
if
(
agc
->
score_avg
<
agc
->
energy_avg
-
agc
->
margin
&&
(
agc
->
vol
<
0
||
agc
->
score_avg
>
agc
->
low_energy_point
))
{
if
(
agc
->
score_avg
<
agc
->
low_energy_point
)
{
agc
->
score_under
=
agc
->
change_factor
+
1
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG1
,
"[%s] BELOW LOW POINT, SCORE AVG: %d ENERGY AVG: %d MARGIN: %d
\n
"
,
agc
->
token
,
agc
->
score_avg
,
agc
->
energy_avg
,
agc
->
margin
);
}
else
if
(((
agc
->
score_avg
<
agc
->
energy_avg
)
&&
(
agc
->
energy_avg
-
agc
->
score_avg
>
agc
->
margin
)))
{
//&& (agc->vol < 0 || agc->score_avg > agc->low_energy_point)) {
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG1
,
"[%s] UNDER++ SCORE AVG: %d ENERGY AVG: %d MARGIN: %d
\n
"
,
agc
->
token
,
agc
->
score_avg
,
agc
->
energy_avg
,
agc
->
margin
);
agc
->
score_under
++
;
...
...
@@ -536,10 +544,12 @@ SWITCH_DECLARE(switch_status_t) switch_agc_feed(switch_agc_t *agc, int16_t *data
agc
->
vol
--
;
switch_normalize_volume_granular
(
agc
->
vol
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG1
,
"[%s] VOL DOWN %d
\n
"
,
agc
->
token
,
agc
->
vol
);
//agc->score_over = 0;
}
else
if
(
agc
->
score_under
>
agc
->
change_factor
)
{
agc
->
vol
++
;
switch_normalize_volume_granular
(
agc
->
vol
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG1
,
"[%s] VOL UP %d
\n
"
,
agc
->
token
,
agc
->
vol
);
//agc->score_under = 0;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论