Xcode 4 no sound

195 Views Asked by At

I'm new and I already looked for an answer my self but I don't get it.

import UIKit
import AVFoundation

class ViewController: UIViewController{

    var player: AVAudioPlayer!

    override func viewDidLoad() {
        super.viewDidLoad()

        let path = Bundle.main.path(forResource: "Volle Möhre", ofType: "mp3")!
        let url = URL(fileURLWithPath: path)
        do {
            player = try AVAudioPlayer(contentsOf: url)
            player.prepareToPlay()
        } catch let error as NSError {
            print(error.description)
        }
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()

    }
    @IBAction func button(_ sender: UIButton) {
        player.play()
    }
}

2018-07-27 15:29:02.879243+0200 volle Möhre[2073:90187] 1410: Problem scanning for packets 2018-07-27 15:29:02.879421+0200 volle Möhre[2073:90187] 1008: MPEGAudioFile::OpenFromDataSource failed 2018-07-27 15:29:02.879518+0200 volle Möhre[2073:90187] 103: OpenFromDataSource failed 2018-07-27 15:29:02.879601+0200 volle Möhre[2073:90187] 78: Open failed Error Domain=NSOSStatusErrorDomain Code=1685348671 "(null)" (lldb)

0

There are 0 best solutions below