如何在运行的 AVAudioEngine 上获取时钟时间或采样准确时间?
最佳答案
来自文档:
The
AVAudioEngine
class defines a group of connectedAVAudioNode
objects, known as audio nodes. You use audio nodes to generate audio signals, process them, and perform audio input and output.
对于时钟和/或采样时间,您需要调用 lastRenderTime
在有效的 AVAudioNode
实例上。
lastRenderTime
方法返回 AVAudioTime
目的。使用 AVAudioTime
,您可以检索时间:
sampleTime
将返回采样时间为sampleTimeValid
返回YES
。
如果 hostTime
将返回主机时间。
hostTimeValid
返回 `YES,关于swift - 获取CPU时钟时间AVAudioEngine,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31856331/