Play audio file as microphone input using AudioKit - for iOS simulator dictation testing

Viewed 264

I am looking for a way of play an audio file and have it as input for the iOS simulator microphone. I am creating a bunch of UI tests for an iOS app that uses dictation (speech-to-text) and I didn't find a way of doing it using applications like SoundFlower, etc as I want to run in the CI and bypassing Apple's security Gatekeeper is not possible as I can't run the machine in recovery mode.

I want to launch the app as an UI test and send some audio to the "device microphone" as a way of triggering a wakeword. Mocking the code here is not an option, or better, not what we want, otherwise we won't test anything.

I was wondering if I can use AudioKit to do this.

1 Answers

I don't think AudioKit will help you with this. I would have thought Soundflower could do it, but you could also try Rogue Amoeba's Loopback if you haven't already.

The iOS simulator does inherit audio from the host Mac, so you could try an old school solution of physically attaching a cable to the microphone input from the output.

Related