根据PJSIP/PJSUA2 documentation的说法,检索/发送音频数据的方法是使用AudioMediaRecorder/AudioMediaPlayer来对文件进行读写。
有没有办法通过流和缓冲区来做到这一点呢?
发布于 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
启动音频流:
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);https://stackoverflow.com/questions/37307749
复制相似问题