Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

456
Views
In iOS 15, 'throwing -10878' occurs many times when connecting AVAudioPlayerNode to mainMixerNode

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?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

To fix this issue change to:

audioEngine.connect(playerNode, to: audioEngine.outputNode, format: audioFile.processingFormat)
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!