构建更好的位置音频 [AudioQueue 操作]

发布于 2024-08-04 01:24:13 字数 652 浏览 4 评论 0原文

我正在构建一个应用程序,它需要真正准确的位置音频,一直到建模耳间时间差 (ITD) 的水平,立体声通道之间的轻微延迟差异随着声音相对于听众的位置而变化。不幸的是,iPhone 的 OpenAL 实现没有此功能,SDK 中也没有提供延迟音频单元。

经过一番阅读后,我决定解决这个问题的最佳方法是通过操作 AudioQueue 来实现我自己的延迟(我还可以看到我未来的一些项目可能需要学习这些东西,所以这就像很好的学习借口)。然而,我根本没有任何低级音频编程的经验,当然也没有 AudioQueue 的经验。尝试同时学习:

a)音频处理的一般理论

b)AudioQueue 如何实现该理论的具体细节

,事实证明,要同时学习太多内容了:(


所以,我的问题是:

1)哪里有一个好地方开始学习 DSP 以及音频生成和处理的一般工作原理(深入到音频数据在内存中的结构方式、混音工作原理等)?

2)有什么好方法可以了解 AudioQueue 是如何做到这一点的?是否有任何好的示例说明如何从生成的环形缓冲区中读取数据,而不是像 Apple 的 SpeakHere 示例那样仅使用 AudioFileReadPackets 按需获取文件的位?

而且,最重要的是

3)是否有一种我忽略的更简单的方法?

I'm building an app that has a requirement for really accurate positional audio, down to the level of modelling inter-aural time difference (ITD), the slight delay difference between stereo channels that varies with a sound's position relative to a listener. Unfortunately, the iPhone's implementation of OpenAL doesn't have this feature, nor is a delay Audio Unit supplied in the SDK.

After a bit of reading around, I've decided that the best way to approach this problem is to implement my own delay by manipulating an AudioQueue (I can also see some projects in my future which may require learning this stuff, so this is as good an excuse to learn as any). However, I don't have any experience in low-level audio programming at all, and certainly none with AudioQueue. Trying to learn both:

a) the general theory of audio processing

and

b) the specifics of how AudioQueue implements that theory

is proving far too much to take in all at once :(


So, my questions are:

1) where's a good place to start learning about DSP and how audio generation and processing works in general (down to the level of how audio data is structured in memory, how mixing works, that kinda thing)?

2) what's a good way to get a feel for how AudioQueue does this? Are there any good examples of how to get it reading from a generated ring buffer, rather that just fetching bits of a file on-demand with AudioFileReadPackets, like Apple's SpeakHere example does?

and, most importantly

3) is there a simpler way of doing this that I've overlooked?

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

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

发布评论

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

评论(2

So尛奶瓶 2024-08-11 01:24:13
  1. 我认为 Richard Lyons 的《理解数字信号处理》被广泛认为是一本很好的 DSP 入门书,尽管它全是数学,没有代码。
  2. 如果计时如此重要,您可能需要使用远程 I/O 音频单元,而不是延迟较高的音频队列。一些音频单元示例可能对您有所帮助,例如“aurioTouch”示例,它使用远程 I/O 单元进行捕获并对其执行 FFT 以获得频率。
  3. 如果内置的 AL 不能为你做到这一点,我认为你已经选择了“疯狂困难”的难度级别。

听起来您可能应该出现在 coreaudio-api 列表 (lists.apple.com) 上,Apple 的 Core Audio 工程师经常去那里。

  1. I think Richard Lyons' "Understanding Digital Signal Processing" is widely revered as a good starter DSP book, though it's all math and no code.
  2. If timing is so important, you'll likely want to use the Remote I/O audio unit, rather than the higher-latency audio queue. Some of the audio unit examples may be helpful to you here, like the "aurioTouch" example that uses the Remote I/O unit for capture and performs an FFT on it to get the frequencies.
  3. If the built-in AL isn't going to do it for you, I think you've opted into the "crazy hard" level of difficulty.

Sounds like you should probably be on the coreaudio-api list (lists.apple.com), where Apple's Core Audio engineers hang out.

黯然 2024-08-11 01:24:13

学习 DSP 基础知识及其应用的另一个重要资源是 Steven W. Smith 所著的《科学家和工程师数字信号处理指南》。可在 http://www.dspguide.com/ 在线免费获取,但您也可以订购印刷本。

我真的很喜欢作者如何以一种非常令人愉快的方式建立基础理论。

此外,您应该查看 Core Audio Public Utility,您可以在 /Developer/Extras/CoreAudio/PublicUtility 中找到它。它涵盖了使用 CoreAudio 所需的许多基本结构。

Another great resource for learning the fundamental basics of DSP and their applications is The Scientist and Engineer's Guide to Digital Signal Processing by Steven W. Smith. It is available online for free at http://www.dspguide.com/ but you can also order a printed copy.

I really like how the author builds up the fundamental theory in a way that very palatable.

Furthermore, you should check out the Core Audio Public Utility which you'll find at /Developer/Extras/CoreAudio/PublicUtility. It covers a lot of the basic structures you'll need to get in place in order to work with CoreAudio.

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