Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
4cbdfbe4
提交
4cbdfbe4
authored
8月 22, 2010
作者:
Luke Dashjr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch_core_asr interfaces for enable_grammar, disable_grammar, and disable_all_grammars
上级
e719ae66
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
71 行增加
和
0 行删除
+71
-0
switch_core.h
src/include/switch_core.h
+24
-0
switch_module_interfaces.h
src/include/switch_module_interfaces.h
+7
-0
switch_core_asr.c
src/switch_core_asr.c
+40
-0
没有找到文件。
src/include/switch_core.h
浏览文件 @
4cbdfbe4
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
* Contributor(s):
* Contributor(s):
*
*
* Anthony Minessale II <anthm@freeswitch.org>
* Anthony Minessale II <anthm@freeswitch.org>
* Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)
*
*
*
*
* switch_core.h -- Core Library
* switch_core.h -- Core Library
...
@@ -1747,6 +1748,29 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t
...
@@ -1747,6 +1748,29 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t
*/
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_core_asr_unload_grammar
(
switch_asr_handle_t
*
ah
,
const
char
*
name
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_asr_unload_grammar
(
switch_asr_handle_t
*
ah
,
const
char
*
name
);
/*!
\brief Enable a grammar from an asr handle
\param ah the handle to enable the grammar from
\param name the name of the grammar to enable
\return SWITCH_STATUS_SUCCESS
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_core_asr_enable_grammar
(
switch_asr_handle_t
*
ah
,
const
char
*
name
);
/*!
\brief Disable a grammar from an asr handle
\param ah the handle to disable the grammar from
\param name the name of the grammar to disable
\return SWITCH_STATUS_SUCCESS
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_core_asr_disable_grammar
(
switch_asr_handle_t
*
ah
,
const
char
*
name
);
/*!
\brief Disable all grammars from an asr handle
\param ah the handle to disable the grammars from
\return SWITCH_STATUS_SUCCESS
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_core_asr_disable_all_grammars
(
switch_asr_handle_t
*
ah
);
/*!
/*!
\brief Pause detection on an asr handle
\brief Pause detection on an asr handle
\param ah the handle to pause
\param ah the handle to pause
...
...
src/include/switch_module_interfaces.h
浏览文件 @
4cbdfbe4
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
* Contributor(s):
* Contributor(s):
*
*
* Anthony Minessale II <anthm@freeswitch.org>
* Anthony Minessale II <anthm@freeswitch.org>
* Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)
*
*
*
*
* switch_module_interfaces.h -- Module Interface Definitions
* switch_module_interfaces.h -- Module Interface Definitions
...
@@ -393,6 +394,12 @@ struct switch_asr_interface {
...
@@ -393,6 +394,12 @@ struct switch_asr_interface {
switch_mutex_t
*
reflock
;
switch_mutex_t
*
reflock
;
switch_loadable_module_interface_t
*
parent
;
switch_loadable_module_interface_t
*
parent
;
struct
switch_asr_interface
*
next
;
struct
switch_asr_interface
*
next
;
/*! function to enable a grammar to the asr interface */
switch_status_t
(
*
asr_enable_grammar
)
(
switch_asr_handle_t
*
ah
,
const
char
*
name
);
/*! function to disable a grammar to the asr interface */
switch_status_t
(
*
asr_disable_grammar
)
(
switch_asr_handle_t
*
ah
,
const
char
*
name
);
/*! function to disable all grammars to the asr interface */
switch_status_t
(
*
asr_disable_all_grammars
)
(
switch_asr_handle_t
*
ah
);
};
};
/*! an abstract representation of an asr speech interface. */
/*! an abstract representation of an asr speech interface. */
...
...
src/switch_core_asr.c
浏览文件 @
4cbdfbe4
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
* Michael Jerris <mike@jerris.com>
* Michael Jerris <mike@jerris.com>
* Paul D. Tinsley <pdt at jackhammer.org>
* Paul D. Tinsley <pdt at jackhammer.org>
* Christopher M. Rienzo <chris@rienzo.net>
* Christopher M. Rienzo <chris@rienzo.net>
* Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)
*
*
*
*
* switch_core_asr.c -- Main Core Library (Speech Detection Interface)
* switch_core_asr.c -- Main Core Library (Speech Detection Interface)
...
@@ -160,6 +161,45 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_unload_grammar(switch_asr_handle
...
@@ -160,6 +161,45 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_unload_grammar(switch_asr_handle
return
status
;
return
status
;
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_asr_enable_grammar
(
switch_asr_handle_t
*
ah
,
const
char
*
name
)
{
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
switch_assert
(
ah
!=
NULL
);
if
(
ah
->
asr_interface
->
asr_enable_grammar
)
{
status
=
ah
->
asr_interface
->
asr_enable_grammar
(
ah
,
name
);
}
return
status
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_asr_disable_grammar
(
switch_asr_handle_t
*
ah
,
const
char
*
name
)
{
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
switch_assert
(
ah
!=
NULL
);
if
(
ah
->
asr_interface
->
asr_disable_grammar
)
{
status
=
ah
->
asr_interface
->
asr_disable_grammar
(
ah
,
name
);
}
return
status
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_asr_disable_all_grammars
(
switch_asr_handle_t
*
ah
)
{
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
switch_assert
(
ah
!=
NULL
);
if
(
ah
->
asr_interface
->
asr_disable_all_grammars
)
{
status
=
ah
->
asr_interface
->
asr_disable_all_grammars
(
ah
);
}
return
status
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_asr_pause
(
switch_asr_handle_t
*
ah
)
SWITCH_DECLARE
(
switch_status_t
)
switch_core_asr_pause
(
switch_asr_handle_t
*
ah
)
{
{
switch_assert
(
ah
!=
NULL
);
switch_assert
(
ah
!=
NULL
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论