是否可以从音频队列服务访问解码的音频数据?

发布于 2024-11-18 07:22:18 字数 223 浏览 9 评论 0原文

我在 App Store 中有一个应用程序,用于通过网络传输压缩音乐文件。我正在使用音频队列服务来处理文件的播放。

我想在文件传输时对其进行一些处理。我测试了音频缓冲区中的数据,但它不是解压缩的音频。如果我正在流式传输 mp3 文件,则缓冲区只是 mp3 数据的一小部分。

我的问题是:使用音频队列服务时是否可以访问未压缩的 PCM 数据?我是否被迫改用音频单元?

I have an app in the App Store for streaming compressed music files over the network. I'm using Audio Queue Services to handle the playback of the files.

I would like to do some processing on the files as they are streamed. I tested the data in the audio buffers, but it is not decompressed audio. If I'm streaming an mp3 file, the buffers are just little slices of mp3 data.

My question is: is it ever possible to access the uncompressed PCM data when using Audio Queue Services? Am I forced to switch to using Audio Units?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终陌 2024-11-25 07:22:18

您可以使用音频转换服务进行自己的 MP3 到 PCM 转换,应用效果,然后将 PCM 而不是 MP3 放入队列。这不会非常容易,但您仍然可以避免直接使用音频单元执行此操作的线程挑战(这将要求您无论如何进行自己的转换,然后可能使用 CARingBuffer 在下载/转换之间发送样本线程和来自IO单元的实时回调线程)

You could use Audio Conversion Services to do your own MP3-to-PCM conversion, apply your effect, then put PCM into the queue instead of MP3. It's not going to be terribly easy, but you'd still be saved the threading challenges of doing this directly with audio units (which would require you to do your own conversion anyways and then probably use a CARingBuffer to send samples between the download/convert thread and the realtime callback thread from the IO unit)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文