'AKOscillator'没有成员'rampTime'

问题描述 投票:2回答:1

我正在尝试遵循以下游乐场教程: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
audiokit
1个回答
0
投票

我通过使用ossitor.rampDuration而不是rampTime摆脱了第一个错误。

对于第二个错误,“导入AudioKitUI”完成了该工作。

© www.soinside.com 2019 - 2024. All rights reserved.