是否可以使用 iPhone 上的音频单元解码 MMS+WMA2 流?
我不确定音频单元是否可以在 iPhone 上的流音频场景中用作编解码器。
我在很多地方都读到过可以做到这一点,但我还没有看到任何示例或适当的文档。相反,我发现大多数发布的应用程序都使用了 ffmpeg 和 libmms。
我很感激你能给我的任何帮助。
I am not sure whether audio units can work as codecs in a streaming audio scenario on the iPhone.
I've read in various places that it can be done, but I haven't seen any examples or proper documentation for that. Instead, I find that most of the apps released have utilised ffmpeg and libmms.
I appreciate any help you can give me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
音频单元的级别非常低,如果您想要进行一些繁重的音频处理(例如实时音频效果),则非常有用。据我所知,音频单元不支持 wma 音频编解码器。为此,您必须使用 FFmpeg 库。
由于 FFmpeg 还支持 mms,因此无需使用 libmms 等其他库来连接到 mms 音频流。您可以使用 FFmpeg 连接到 mms 音频流,如下所示:
要解码音频数据,您可以使用 avcodec_decode_audio3 函数。一旦准备好解码的音频数据,我建议您使用 AudioQueue 框架进行播放。 AudioQueue 通过调用您定义的回调函数来请求您提供音频数据。这些回调函数之一是 AudioQueueOutputCallback,您可以在其中传递解码的音频数据,如下所示:
Audio Units are very low-level and are useful if you want to do some heavy audio processing like realtime audio effects. As far as I know Audio Units doesn't support the wma audio codec. You'll have to use the FFmpeg library for this.
Since FFmpeg also supports mms it's not necessary to use another library like libmms to connect to mms audio streams. You can connect to mms audio streams with FFmpeg like this:
For decoding the audio data you can use the avcodec_decode_audio3 function. Once you have the decoded audio data ready I suggest you use the AudioQueue framework for playback. AudioQueue works by calling callback functions you've defined to ask you for audio data. One of these callback functions is the AudioQueueOutputCallback where you can pass the decoded audio data like this:
再次查看这一点,与 Mac OS X 不同,iOS 似乎只允许内置音频单元。内置音频单元在“iOS 音频单元托管指南”-> 中进行了描述。 “使用特定音频单元”,可以在线找到
Having looked at this again, it appears that iOS allows only for built-in audio units, unlike Mac OS X. Built-in audio units are described in "Audio Unit Hosting Guide for iOS" -> "Using Specific Audio Units", which can be found online here.