How to Detect Speech On iOS Swift

Let me tell you how you can do speech recognition on iOS using swift.

Abhimuralidharan
2 min readApr 3, 2017
Photo by Ingo Schulz on Unsplash

iOS 10 introduces a new API for speech recognition. WWDC video link: https://developer.apple.com/videos/play/wwdc2016/509/

These apis helps us to convert audio of human speech to text to use within the application. It uses the same technology of that of Siri. The apple doc says that the speech recognition api is so powerful that it can give more information about the recognised data like the confidence level, more interpretation about what the user might have said, timing info etc.

The audio for recognition can be either a pre-recorded file or a live audio from a microphone. Any device running iOS 10 and above supports this feature and it can recognise upto 50 languages.

Active internet connection is required to perform this operation in most cases. Doc says that there are some exceptions which doesn’t require internet. The Speech APIs perform speech recognition by communicating with Apple’s servers or using an on-device speech recognizer, if available. To find out if a speech recognizer is available for a specific language, you adopt the SFSpeech​Recognizer​Delegate protocol.

Because your app may need to connect to the servers to perform recognition, it’s essential that…

--

--