如何获得对触摸事件的最低音频延迟响应?

时间:2019-05-29 09:30:23

标签: audiokit

我正在开发节奏游戏,并尝试使用AudioKit向用户提供极低延迟的音频响应。

我是AudioKit的新手,在Hello World示例之后,我使用AKOscillator构建了一个非常简单的测试应用程序:

...
let oscillator = AKOscillator()
...
AudioKit.output = oscilator
oscillator.frequency = 880
AKSettings.bufferLength = .shortest
AKSettings.ioBufferDuration = 0.002
AudioKit.start()

... // On Touch event ///
oscillator.start()
... // 20 ms later ///
oscillator.stop()

我测量了触摸事件和发出第一声声音之间的等待时间,大约是100毫秒,这对于我们来说很慢...

我想不到的可能性:

  1. 100毫秒达到了音频输出延迟的硬件限制

  2. 更多魔术设置可以解决此问题

  3. oscillator.start()有一定的延迟,要实现最低的延迟,我应该使用其他方法

  4. 代码的其他部分出了点问题(触摸处理等)

由于我现在已经在AudioKit(也没有iOS音频系统...)上体验过,因此,非常感谢您提供任何信息!

0 个答案:

没有答案