Home › Forums › OpenEars › [pocketsphinxController stopListening]error. › Reply To: [pocketsphinxController stopListening]error.
I took a look and this is correct behavior. OpenEars is not setting the route, it is only setting the audiosession inactive once it is done using it, which is a requirement for any object which makes audio session changes once it is done using the session.
The side-effect of releasing the audio session is that iOS sets routes and session types when the session is released. This is not possible for OpenEars to control.
If your AVAudioPlayers need a particular audio session or route, you can set them in the AVAudioPlayer initialization or playback code, and (if necessary) unset them in the AVAudioPlayer playback completion callback. Does that makes sense?
I unfortunately can’t prevent this from happening because it doesn’t start with OpenEars, it a behavior of the operating system. The only way to change the behavior would be to not release the audio session, but that isn’t correct handling for an object that has changed the audio session and doesn’t need its changes any more.
Another alternative to avoid releasing the audio session would be to use suspend and resume instead of start and stop for your listening session.