AKAudioPlayer
の宣言方法は?AKAudioPlayerでサウンドを再生する - iOS
私は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()
}
}
ありがとうございました – EssamSoft
よろしくお願いします! –