swift - 获取CPU时钟时间AVAudioEngine

标签 swift avaudioengine

如何在运行的 AVAudioEngine 上获取时钟时间或采样准确时间?

最佳答案

来自文档:

The AVAudioEngine class defines a group of connected AVAudioNode 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,您可以检索时间:

  1. sampleTime 将返回采样时间为 sampleTimeValid 返回 YES
  2. 如果 hostTimeValid 返回 `YES,
  3. hostTime 将返回主机时间。

关于swift - 获取CPU时钟时间AVAudioEngine,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31856331/

相关文章:

swift - Swift 4 中的 HMAC SHA256

swift - 计时问题: Metronome using AVAudioEngine scheduleBuffer's completion handler

swift 3 : Quickly playing sounds on AVAudioPlayerNode

iOS 通过 AVAudioUnitTimePitch 播放时调整音调

avaudioengine - 动态重新连接 AVAudioEngine 节点而不停止声音

ios - 将 UITableViewCellAccessoryType 上的默认附件类型设为按钮

Swift 如何等待异步函数完成

swift - AVAudioPlayerNode 播放指定次数的声音

iOS VoIP 推送通知在 1-2 秒后自动停止

swift - 如何在两个不同的键中解码具有相同变量的 JSON?