2 years ago

#53779

test-img

Hope

SCNAudioPlayer is throwing -10878

I start playing an audio file like this in a SceneKit app; It is playing the file surprisingly!

I can call first function to start playing again.

But at first call to start player I am having this message many times; I could not find why.

testsScene[17737:968214] throwing -10878

var backgroundAudioPlayer:SCNAudioPlayer?


func someFunction(){

  DispatchQueue.main.async { [self] in
            backgroundAudioPlayer = SCNAudioPlayer(source: "background0.mp3")
            worldNode.addAudioPlayer(backgroundAudioPlayer!)
        }

}

and stop in this way;

func someOtherFunction(){
  DispatchQueue.main.async { [self] in
                
    worldNode.removeAudioPlayer(backgroundAudioPlayer!)

               }

 }

ios

swift

scenekit

0 Answers

Your Answer

Accepted video resources