PJSIP自动语音功能,WAV文件远程播放,可以与TTS整合
2014-01-07 16:06
726 查看
使用PJSIP进行自动语音功能,卡了好久,最终发现其实还是比较简单的。
PJSIP就是比较强大,很多都实现好了,都不需要去很深地了解协议。
说实在的话,我就不了解SIP协议的细节。
PJSUA has rather powerful media features, which are built around the PJMEDIA conference bridge. Basically, all media "ports" (such as calls, WAV players, WAV playlist, file recorders, sound device, tone generators, etc) are terminated in the conference
bridge, and application can manipulate the interconnection between these terminations freely.
The conference bridge provides powerful switching and mixing functionality for application. With the conference bridge, each conference slot (e.g. a call) can transmit to multiple destinations, and one destination can receive from multiple sources.
If more than one media terminations are terminated in the same slot, the conference bridge will mix the signal automatically.
Application connects one media termination/slot to another by calling pjsua_conf_connect() function. This will establish unidirectional media flow from the source termination to the sink termination. To establish bidirectional media flow, application
wound need to make another call to pjsua_conf_connect(), this time inverting the source and destination slots in the parameter.
For example, to stream a WAV file to remote call, application may use the following steps:
pj_status_t stream_to_call( pjsua_call_id call_id )
{
pjsua_player_id player_id;
status = pjsua_player_create("mysong.wav", 0, NULL, &player_id);
if (status != PJ_SUCCESS)
return status;
status = pjsua_conf_connect( pjsua_player_get_conf_port(),
pjsua_call_get_conf_port() );
}
Other features of PJSUA media:
efficient N to M interconnections between media terminations.
media termination can be connected to itself to create loopback media.
the media termination may have different clock rates, and resampling will be done automatically by conference bridge.
media terminations may also have different frame time; the conference bridge will perform the necessary bufferring to adjust the difference between terminations.
interconnections are removed automatically when media termination is removed from the bridge.
sound device may be changed even when there are active media interconnections.
correctly report call's media quality (in pjsua_call_dump()) from RTCP packet exchange.
PJSIP就是比较强大,很多都实现好了,都不需要去很深地了解协议。
说实在的话,我就不了解SIP协议的细节。
PJSUA has rather powerful media features, which are built around the PJMEDIA conference bridge. Basically, all media "ports" (such as calls, WAV players, WAV playlist, file recorders, sound device, tone generators, etc) are terminated in the conference
bridge, and application can manipulate the interconnection between these terminations freely.
The conference bridge provides powerful switching and mixing functionality for application. With the conference bridge, each conference slot (e.g. a call) can transmit to multiple destinations, and one destination can receive from multiple sources.
If more than one media terminations are terminated in the same slot, the conference bridge will mix the signal automatically.
Application connects one media termination/slot to another by calling pjsua_conf_connect() function. This will establish unidirectional media flow from the source termination to the sink termination. To establish bidirectional media flow, application
wound need to make another call to pjsua_conf_connect(), this time inverting the source and destination slots in the parameter.
For example, to stream a WAV file to remote call, application may use the following steps:
pj_status_t stream_to_call( pjsua_call_id call_id )
{
pjsua_player_id player_id;
status = pjsua_player_create("mysong.wav", 0, NULL, &player_id);
if (status != PJ_SUCCESS)
return status;
status = pjsua_conf_connect( pjsua_player_get_conf_port(),
pjsua_call_get_conf_port() );
}
Other features of PJSUA media:
efficient N to M interconnections between media terminations.
media termination can be connected to itself to create loopback media.
the media termination may have different clock rates, and resampling will be done automatically by conference bridge.
media terminations may also have different frame time; the conference bridge will perform the necessary bufferring to adjust the difference between terminations.
interconnections are removed automatically when media termination is removed from the bridge.
sound device may be changed even when there are active media interconnections.
correctly report call's media quality (in pjsua_call_dump()) from RTCP packet exchange.
相关文章推荐
- 如何将语音文件转换为Asterisk可以播放的音频格式文件(.wav)
- 【转载】Flex调用外部JS实现播放语音文件功能
- 消息语音播报,微信语音自动播放,有点儿意思,可以看看这个应用
- 怎么关闭Win7的自动播放功能让Win7不自动播放文件
- 哈哈,毒霸可以直接关闭自动播放功能,真是太棒了
- ireport 取消自动分页,detail不分页 报表文件属性页面lgnore pagination 勾选上,就可以取消分页功能。
- C++ builder TTS5.1实现语音播放 生成wav文件
- SSH 整合(权限管理,文件上传,displaytag集成,lookup自动填写功能...)
- Android-文件及字符流方式的语音保存播放功能
- 使用jacob+SAPI5.1实现将将文字转换为语音播放并可存储到.wav文件
- java.media类实现的可以播放WAV和MP3格式的文件
- wave文件(*.wav)格式、PCM数据格式, goldwave 可以播放pcm raw audio
- 如何通过组策略自动启用客户端远程桌面功能?
- windowsXP系统关机时自动清理页面文件的功能开启步骤(默认关闭)
- Git学习-->如何通过Shell脚本自动定时将Gitlab备份文件复制到远程服务器?
- ios开发视频播放后台下载功能实现 :1,ios播放视频 ,包含基于AVPlayer播放器,2,实现下载,iOS后台下载(多任务同时下载,单任务下载,下载进度,下载百分比,文件大小,下载状态)(真机调试功能正常)
- Android 图片滚动,加入自动播放功能,使用自定义属性实现,霸气十足!
- Ubuntu 11.10 通过配置vnc使windows可以远程桌面,自动启动(转)
- shell自动备份文件或目录到本地和远程主机
- 技巧:关闭U盘自动播放功能