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

447
Views
En iOS 15, 'lanzar -10878' ocurre muchas veces al conectar AVAudioPlayerNode a mainMixerNode

Encontré un problema al ejecutar el siguiente código en iOS 15. Esto ocurre tanto en un simulador como en un dispositivo real. Además, esto no ocurre en 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) } } }

Imprimirá estas salidas.

 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

Aunque ocurren estos errores, los sonidos se pueden reproducir sin fallas. Sin embargo, consume mucho tiempo para la inicialización de lo habitual. ¿Hay alguna manera de resolver este problema?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Para solucionar este problema, cambie a:

 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!