Search code examples
iosswiftaudiomicrophone

Can an iOS app passivly listen for a certain sound?


I know the iPhone responds to "hey Siri". Is there similar features that I can use in my app to listen for certain sounds? If so what is the name of the iOS framework to use?


Solution

  • No, there is no API for that. Hey Siri is part of the OS and has hardware-level support. Your app can only use the microphones while it’s running; there is support for keeping the app alive while it’s recording audio, but the battery impact would be severe—the device can’t go to sleep—so it would be extremely unlikely to pass app review. That said, if you’d like API support to be added in future, please file an enhancement request with the use case you have in mind.