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
오신 것을 환영합니다! –