Question

I am using openCL to play sounds and I have noted that the sounds stop functioning after a call enters and I press Decline. I was able to trace it to the endInterruption not being called.

The problem is that this happens only about once out of 5 times I repeat the replication. This means that my code is ok, because in the majority of times it does call endInterruption, but still every other time iOS decides not to call endInterruption and I have no idea why.

Was it helpful?

Solution

Check if you are calling the "play" functions from a background thread instead of the main thread. If sometimes you initiate the play/playAtTime call from a background thread, you will not receive the endInterruption callback.

Interestingly though, the system does call beginInterruption even when the play call was initiated from a background thread.

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top