Following up my own response, I fixed it by changing the output device before creating the audiokit engine with a microphone output. The fault appears to be that the phone switches to 'telephone' mode and stops using the normal speakers when the microphone is enabled if you haven't specifically told it NOT to do this. Anyway, apparently this call prevents that from occuring:
AVAudioSession.sharedInstance().overrideOutputAudioPort(.speaker)