【问题标题】:PJSIP/PJSUA2 - stream AudioMediaPlayer / AudioMediaRecorderPJSIP/PJSUA2 - 流 AudioMediaPlayer / AudioMediaRecorder
【发布时间】:2016-05-18 18:42:59
【问题描述】:

根据PJSIP/PJSUA2 documentation,获取/发送音频数据的方法是使用AudioMediaRecorder/AudioMediaPlayer 向/从文件写入/读取数据。

有没有办法用流和缓冲区做到这一点?

【问题讨论】:

  • 就像 JMR 所说的,使用pjmedia_aud_stream 似乎可以做这样的事情(更多信息here
  • 我根据你的评论更新了我的答案。
  • 如果我的回答在某些方面有所帮助,您可以接受答案为 coorect。

标签: c++ audio streaming pjsip


【解决方案1】:

你想要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

启动音频流:

status = pjmedia_aud_stream_start(stream);

要停止流:

status = pjmedia_aud_stream_stop(stream);

并销毁流:

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);

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2021-12-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-04-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多