如何申报AKAudioPlayer
?
我正在使用AudioKit Lib
,我只需要帮助来.wav
使用更改文件按钮播放文件。
import UIKit
import AudioKit
class ViewController: UIViewController {
let file = NSBundle.mainBundle().pathForResource("song", ofType: "wav")
let song = AKAudioPlayer(file!) // <--- ERROR = instance member 'file' cannot be used on type
override func viewDidLoad() {
super.viewDidLoad()
AudioKit.output = song
AudioKit.start()
song.play()
}
@IBAction func btn(sender: AnyObject) {
song.replaceFile("NewFile")
song.play()
}
}