freeswitch智能语音开发之ASR

本文介绍了freeswitch中使用ASR技术的两种方法:detect_speech和play_and_detect_speech,以及如何通过事件监听获取识别结果。同时,讨论了实现自定义ASR模块的三种方式,包括mrcp对接和mediabug接口实现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ASR(Automatic Speech Recognition)自动语音识别技术是一种将人的语音转换为文本的技术。

一、freeswitch如何使用asr

freeswitch提供两个app功能detect_speech和play_and_detect_speech给用户调用,detect_speech是异步的,play_and_detect_speech是同步的。

1、detect_speech

1.1语法:detect_speech <mod_name> <gram_name> <name> <dest>

detect_speech stop 

mod_name: 识别模块名称 如ali_asr[:params],其中params是param1=value1,param2=value2类型格式传入到switch_asr_interface_t接口中asr_open接口函数

gram_name:switch_asr_interface_t接口中asr_load_grammar接口函数传入参数

name: switch_asr_interface_t接口中asr_load_grammar接口函数传入参数

dest:switch_asr_interface_t接口中asr_open接口函数传入参数

stop:停止识别

1.2识别事件:设置通道变量fire_asr_events为true。freeswitch会触发SWITCH_EVENT_DETECTED_SPEECH事件返回给事件回调函数。

1.2.1事件头Speech-Type:

begin-speaking:检测到用户说话

detected-speech:识别结果

closed:识别关闭

1.2.2 事件body

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值