AudioQueue内存播放示例

发布于 2024-09-05 17:36:28 字数 163 浏览 2 评论 0原文

有人知道使用 AudioQueue 从内存源播放的任何示例吗?

我可以从文件中找到播放的所有示例(使用 AudioFileReadPackets),但在我的特定情况下,我自己实时生成数据,因此理想情况下,我想自己将数据排入队列,而不是使用回调将其从文件中吸出。

非常感谢任何帮助。

Does anybody know of any examples using AudioQueue that play from an in-memory source?

All the examples I can find play from files (using AudioFileReadPackets) but in my particular case I am generating the data myself in realtime so ideally, I want to enqueue the data myself rather than sucking it out of a file using the callback.

Any help much appreciated.

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

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

发布评论

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

评论(3

天邊彩虹 2024-09-12 17:36:29

我知道一个使用您可以调整的音频单元的示例,因为回调非常相似,请尝试 这里

i know of an example using audio units that you could adapt, as the callbacks are very similiar, try here

一紙繁鸢 2024-09-12 17:36:29

音频队列服务编程指南应该为您提供所需的详细信息,但显然对您正在寻找的具体示例有点宽松。您只需将内存中的音频数据推送到输出队列,而不是通过 AudioFileReadPackets 从文件中推送 PCM 数据。

我在另一个 stackoverflow 中的 AudioQueue 播放器回调中找到了一个合理的声音合成示例问题

The Audio Queue Services Programming Guide should give you the details you need but obviously is a bit lax on the specific example you are looking for. You just need to push the in-memory audio data through the output queue instead of the PCM data from the file via AudioFileReadPackets.

I found a reasonable example of sound synthesis in the AudioQueue player callback in another stackoverflow question.

檐上三寸雪 2024-09-12 17:36:29

SpeakHere 示例可能是最适合您的示例。该示例记录设备中的声音并播放。您可以在 Apple 示例站点中找到此示例。

SpeakHere Example may be the best example for you. The example records sound from device and play it. You can find this example in the Apple sample site.

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