Play Audio and Recognize Speech in Car

Hello,

I'm trying to determine the best/recommended AVAudioSession configuration (i.e category, mode, and options) for the following use-case.

Essentially, I'd like to switch between periods of playing an audio file and then recognizing speech. The audio file is typically speech and I don't intend for playback and speech recognition to occur simultaneously. I'd like for the user to sill be able to interact with Siri and I'd like for it to work with CarPlay where navigation prompts can occur.

I would assume the category to use is 'playAndRecord', but I'm not sure if it's better to just set that once for the entire lifecycle, or set to 'playback' for audio file playback and then switch to 'playAndRecord' for speech recognition . I'm also not sure on the best 'mode' and 'options' to set. Any suggestions would be appreciated.

Thanks.

Play Audio and Recognize Speech in Car
 
 
Q