首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PJSIP/PJSUA2 -流AudioMediaPlayer / AudioMediaRecorder

PJSIP/PJSUA2 -流AudioMediaPlayer / AudioMediaRecorder
EN

Stack Overflow用户
提问于 2016-05-19 02:43:00
回答 1查看 1.4K关注 0票数 4

根据PJSIP/PJSUA2 documentation的说法,检索/发送音频数据的方法是使用AudioMediaRecorder/AudioMediaPlayer来对文件进行读写。

有没有办法通过流和缓冲区来做到这一点呢?

EN

回答 1

Stack Overflow用户

发布于 2016-05-26 18:06:22

你想要像这样的http://www.pjsip.org/pjmedia/docs/html/page_pjmedia_samples_playfile_c.htm吗?

--更新--

用户建议的解决方案:

http://www.pjsip.org/pjmedia/docs/html/group__audio__device__api.htm

启动音频流:

代码语言:javascript
复制
status = pjmedia_aud_stream_start(stream);

要停止流,请执行以下操作:

代码语言:javascript
复制
status = pjmedia_aud_stream_stop(stream);

要破坏这条流:

代码语言:javascript
复制
status = pjmedia_aud_stream_destroy(stream);

Info: The following shows how to retrieve the capability value of the stream (in this case, the current output volume setting).
// Volume setting is an unsigned integer showing the level in percent.
unsigned vol;
status = pjmedia_aud_stream_get_cap(stream,
PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING,
&vol);
Info: And following shows how to modify the capability value of the stream (in this case, the current output volume setting).
// Volume setting is an unsigned integer showing the level in percent.
unsigned vol = 50;
status = pjmedia_aud_stream_set_cap(stream,
PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING,
&vol);
票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37307749

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档