Skip to content

Latest commit

History

History

SpeechRecognition

Speech Recognition

This application demonstrates how to work with a complex dependency in the Composable Architecture. It uses theSFSpeechRecognizerAPI from theSpeechframework to listen to audio on the device and live-transcribe it to the UI.

TheSFSpeechRecognizerclass is a complex dependency, and if we used it freely in our application we wouldn't be able to test any of that code. So, instead, we wrap the API in aSpeechClienttype that exposes asynchronous endpoints for accessing the underlyingSFSpeechRecognizerclass. Then we can use it in the reducer in an understandable way,andwe can write tests for the reducer.