Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
573058c6
提交
573058c6
authored
3月 21, 2007
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
shhhh
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@4716
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
2da36dea
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
30 行增加
和
1 行删除
+30
-1
switch_resample.h
src/include/switch_resample.h
+8
-0
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+1
-1
switch_resample.c
src/switch_resample.c
+21
-0
没有找到文件。
src/include/switch_resample.h
浏览文件 @
573058c6
...
@@ -154,6 +154,14 @@ SWITCH_DECLARE(int) switch_short_to_float(short *s, float *f, int len);
...
@@ -154,6 +154,14 @@ SWITCH_DECLARE(int) switch_short_to_float(short *s, float *f, int len);
*/
*/
SWITCH_DECLARE
(
void
)
switch_swap_linear
(
int16_t
*
buf
,
int
len
);
SWITCH_DECLARE
(
void
)
switch_swap_linear
(
int16_t
*
buf
,
int
len
);
/*!
\brief Generate static noise
\param data the audio data buffer
\param samples the number of 2 byte samples
\param divisor the volume factor
*/
SWITCH_DECLARE
(
void
)
switch_generate_sln_silence
(
int16_t
*
data
,
uint32_t
samples
,
uint32_t
divisor
);
/*!
/*!
\brief Change the volume of a signed linear audio frame
\brief Change the volume of a signed linear audio frame
\param data the audio data
\param data the audio data
...
...
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
573058c6
...
@@ -1696,7 +1696,7 @@ static void conference_loop_output(conference_member_t *member)
...
@@ -1696,7 +1696,7 @@ static void conference_loop_output(conference_member_t *member)
}
else
{
}
else
{
if
(
switch_test_flag
(
member
,
MFLAG_WASTE_BANDWIDTH
))
{
if
(
switch_test_flag
(
member
,
MFLAG_WASTE_BANDWIDTH
))
{
memset
(
write_frame
.
data
,
255
,
bytes
);
switch_generate_sln_silence
(
write_frame
.
data
,
samples
,
1400
);
write_frame
.
datalen
=
bytes
;
write_frame
.
datalen
=
bytes
;
write_frame
.
samples
=
samples
;
write_frame
.
samples
=
samples
;
write_frame
.
timestamp
=
timer
.
samplecount
;
write_frame
.
timestamp
=
timer
.
samplecount
;
...
...
src/switch_resample.c
浏览文件 @
573058c6
...
@@ -183,6 +183,27 @@ SWITCH_DECLARE(void) switch_swap_linear(int16_t *buf, int len)
...
@@ -183,6 +183,27 @@ SWITCH_DECLARE(void) switch_swap_linear(int16_t *buf, int len)
}
}
}
}
SWITCH_DECLARE
(
void
)
switch_generate_sln_silence
(
int16_t
*
data
,
uint32_t
samples
,
uint32_t
divisor
)
{
int16_t
rnd
,
x
,
i
;
uint32_t
sum_rnd
=
0
;
assert
(
divisor
);
for
(
i
=
0
;
i
<
samples
;
i
++
,
sum_rnd
=
0
)
{
for
(
x
=
0
;
x
<
7
;
x
++
)
{
rnd
=
(
int16_t
)
(
rand
()
*
sizeof
(
int16_t
));
sum_rnd
+=
rnd
;
}
switch_normalize_to_16bit
(
sum_rnd
);
*
data
=
(
int16_t
)
sum_rnd
;
*
data
/=
(
int
)
divisor
;
data
++
;
}
}
SWITCH_DECLARE
(
void
)
switch_change_sln_volume
(
int16_t
*
data
,
uint32_t
samples
,
int32_t
vol
)
SWITCH_DECLARE
(
void
)
switch_change_sln_volume
(
int16_t
*
data
,
uint32_t
samples
,
int32_t
vol
)
{
{
double
newrate
=
0
;
double
newrate
=
0
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论