Post

Replies

Boosts

Views

Created

AVAudioPlayer doesn't work on iOS 13 Simulator (Xcode 12.4)
language import UIKit import AVFoundation class ViewController: UIViewController {       var audio: AVAudioPlayer?   override func viewDidLoad() {     super.viewDidLoad()           do {         let path = Bundle.main.path(forResource: "music.mp3", ofType:nil)!       let url = URL(fileURLWithPath: path)       audio = try AVAudioPlayer(contentsOf: url)       audio?.play()             } catch {       print("error: \(error)")     }        } } It works on iOS 14 Simulator. Errors: HALB_IOBufferManager_Client::GetIOBuffer: the stream index is out of range
2
0
1.9k
Mar ’21