我已将AudioKit升级到4.6.1,现在无法编译我的应用程序。出现的2个问题已连接到AKCallbackInstrument类。
第一:
callbackTrack?.setMIDIOutput(callbackInstrument.midiIn)
提出Value of type 'AKCallbackInstrument' has no member 'midiIn'
因为AKCallbackInstrument继承自AKMIDIInstrument
而被淘汰
第二:
callbackInstrument.callback = { status, noteNumber, velocity in
if(status == .noteOn){
// ...
}
}
这个注释:qazxsw poi,我在SO上看过这个问题,但没有任何帮助。
谢谢 :)
这看起来是由于MIDIStatus是一个类型更改为MIDIStatus是一个包含类型的对象。
Ambiguous reference to member '=='
所以,尝试将代码更改为s
public struct AKMIDIStatus {
...
public var type: AKMIDIStatusType? {
return AKMIDIStatusType(rawValue: Int(byte.highBit))
}
因为我个人提出的问题很少,所以我会在这里发布一些对我来说有用的答案。
使用if status.type == .noteOn {
//
}
更改AKCallbackInstrument
,API应该按预期工作。
*请确保使用比4.6.1更新的版本作为修复程序,并在此版本发行版中对MIDI组件进行了更改。