I encountered a problem when executing the following code on iOS 15. This occurs on both a simulator and a real device. In addition, this doesn't occur on iOS 14.
import AVFoundation
class MyAudio {
let audioEngine: AVAudioEngine
let audioFile: AVAudioFile
let playerNode: AVAudioPlayerNode
init() {
audioFile = try! AVAudioFile(forReading: Bundle.main.url(forResource: "sound", withExtension: "mp3")!)
audioEngine = AVAudioEngine()
playerNode = AVAudioPlayerNode()
audioEngine.attach(playerNode)
audioEngine.connect(playerNode, to: audioEngine.mainMixerNode, format: audioFile.processingFormat)
do {
try audioEngine.start()
playerNode.play()
} catch {
print(error.localizedDescription)
}
}
}
It will print these outputs.
2021-10-02 17:29:14.534934+0900 audio-sample-2021-10-02[11337:353838] throwing -10878
2021-10-02 17:29:14.537588+0900 audio-sample-2021-10-02[11337:353838] throwing -10878
2021-10-02 17:29:14.537895+0900 audio-sample-2021-10-02[11337:353838] throwing -10878
2021-10-02 17:29:14.538194+0900 audio-sample-2021-10-02[11337:353838] throwing -10878
2021-10-02 17:29:14.538512+0900 audio-sample-2021-10-02[11337:353838] throwing -10878
2021-10-02 17:29:14.538822+0900 audio-sample-2021-10-02[11337:353838] throwing -10878
2021-10-02 17:29:14.539127+0900 audio-sample-2021-10-02[11337:353838] throwing -10878
2021-10-02 17:29:14.539434+0900 audio-sample-2021-10-02[11337:353838] throwing -10878
2021-10-02 17:29:14.539789+0900 audio-sample-2021-10-02[11337:353838] throwing -10878
Although these errors occur, the sounds can be played without any crashes. However, it consumes a lot of time for initializing than usual. Is there any way for resolving this problem?
Another issue that has seemingly haunted many iOS 15 users is the random app crashing problem. While some apps tend to crash out right after the launch, others crash while in use. From what I can tell based on my experience, this issue can be sorted out by simply updating the apps.
While it’s usual to expect unexpected issues in a new software update, very few had imagined that iOS 15 would be so buggy after rigorous beta testing. Certainly not to this magnitude! Alarmed by several persistent issues, Apple had to rush with a minor update mostly focused on bug fixes. Still, problems are far from over.
If you don’t see the iOS 15 or iPadOS 15 update at all, it may be because the device does not have internet service, or because the device is not compatible with iOS 15 or iPadOS 15. Be sure to check iOS 15 compatibility and iPadOS 15 compatibility to make sure your device can run the new system software. 3.
App Crashing Issue in iOS 15 Another issue that has seemingly haunted many iOS 15 users is the random app crashing problem. While some apps tend to crash out right after the launch, others crash while in use. From what I can tell based on my experience, this issue can be sorted out by simply updating the apps.
To fix this issue change to:
audioEngine.connect(playerNode, to: audioEngine.outputNode, format: audioFile.processingFormat)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With