Android RtpStream使用示例
从 Android API 12 开始,SDK 支持 RTP ,其中包括RtpStream作为基类,以及AudioStream、AudioCodec和AudioGroup。但是,没有文档、示例或教程来帮助我使用这些特定的 API 从设备的麦克风获取输入并将其输出到 RTP 流。
在哪里指定使用麦克风作为信号源而不使用扬声器?它执行任何 RTCP 吗?我可以扩展 RtpStream 基类来创建我自己的 VideoStream 类(理想情况下我也想将它们用于视频流)吗?
对于这些新的 API 有什么帮助吗?
Since Android API 12, RTP is supported in the SDK, which includes RtpStream as the base class, and AudioStream, AudioCodec, and AudioGroup. However, there is no documentation, examples, or tutorials to help me use these specific APIs to take input from the device's microphone, and output it to an RTP stream.
Where do I specify using the mic as the source, and not to use a speaker? Does it perform any RTCP? Can I extend the RtpStream base class to create my own VideoStream class (ideally I would like to use these for video streaming too)?
Any help out there on these new(ish) APIs please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,这些 API 是执行实际工作的本机代码的最薄的必要包装。这意味着它们不能在 java 中扩展,并且要在 C++ 中扩展它们,我相信您必须有一个自定义的 Android 版本。
据我所知,AudioGroup 实际上无法设置为不输出声音。
我不相信它有 RTCP,但我对它的使用不涉及 RTCP,所以我不知道。
我的建议是,如果您希望能够扩展功能或拥有更大的灵活性,那么您应该找到某人编写或移植到 Android 的 C 或 C++ 本机库并使用它,这应该允许您控制它的音频使用并添加视频流和其他此类扩展。
Unfortunately these APIs are the thinnest necessary wrapper around native code that performs the actual work. This means that they cannot be extended in java, and to extend them in C++ you would have to have a custom Android version I believe.
As far as I can see the AudioGroup cannot actually be set to not output sound.
I don't believe it does an RTCP but my use of it doesn't involve RTCP so I would not know.
My advice is that if you want to be able to extend functionality or have greater flexibility, then you should find a C or C++ native library that someone has written or ported to Android and use that instead, this should allow you to control what audio it uses and add video streaming and other such extensions.