我正在尝试遵循以下游乐场教程:https://www.raywenderlich.com/835-audiokit-tutorial-getting-started
我正在尝试遵循此部分:
oscillator.rampTime = 0.2
oscillator.frequency = 500
AKPlaygroundLoop(every: 0.5) {
oscillator.frequency =
oscillator.frequency == 500 ? 100 : 500
}
但是我遇到了这些错误:
error: Oscillators.xcplaygroundpage:13:1: error: value of type 'AKOscillator' has no member 'rampTime'
oscillator.rampTime = 0.2
^~~~~~~~~~ ~~~~~~~~
error: Oscillators.xcplaygroundpage:15:1: error: use of unresolved identifier 'AKPlaygroundLoop'
AKPlaygroundLoop(every: 0.5) {
我已导入以下内容:
import AudioKitPlaygrounds
import AudioKit
import PlaygroundSupport
我通过使用ossitor.rampDuration而不是rampTime摆脱了第一个错误。
对于第二个错误,“导入AudioKitUI”完成了该工作。