1

エラー Thread1: EXC_BAD_INSTRUCTION があります。これに非常に一生懸命取り組んできました。役に立つ人員はいますか?

import UIKit import AVFoundation

class PlaySoundsViewController: UIViewController {

var filePathUrl: NSURL!
var audioPlayer: AVAudioPlayer?
var receivedAudio:RecordedAudio!

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view.


    audioPlayer = try! AVAudioPlayer(contentsOfURL: receivedAudio.filePathUrl)
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

@IBAction func playFastAudio(sender: UIButton) {
    audioPlayer!.stop()
    audioPlayer!.rate = 1.5
    audioPlayer!.currentTime = 0.0
    audioPlayer!.play()
}

@IBAction func playSlowAudio(sender: UIButton) {
    // play audio slow
    audioPlayer!.stop()
    audioPlayer!.rate = 0.5
    audioPlayer!.currentTime = 0.0
    audioPlayer!.play()


}
@IBAction func StopButtonSound(sender: UIButton) {
    audioPlayer!.stop()
}

}

4

0 に答える 0