Reply To: Can't play audio

Home Forums OpenEars Can't play audio Reply To: Can't play audio

Halle Winkler

Hi Derek,

This is default functionality (FliteController and FliteController+NeatSpeech both use AVAudioPlayer to play back synthesized speech simultaneously with PocketsphinxController whether suspended or not, so it has to be compatible), so I would start by troubleshooting the actual audio file and its playback outside of the OpenEars context.

It isn’t clear from the code excerpt above how you resume listening, but if your goal is to suspend, completely play your audio, and resume, you probably also need to hook up the AVAudioPlayer delegate methods so you can resume on the callback that your AVAudioPlayer playback completed rather than simultaneously starting playback and calling resume, which could maybe turn into a race condition for audio resources.

You can also peek at FliteController to see an example of AVAudioPlayer usage during PocketsphinxController listening which is known to work.

Signature: Did you know that OpenEars has a credit requirement in its license? It’s true! You can read more about it here: