Contents

DictationTranscriber

A speech-to-text transcription module that’s similar to system dictation features and compatible with older devices.

Declaration

final class DictationTranscriber

Overview

This transcriber uses the same speech-to-text machine learning models as system dictation features do, or as SFSpeechRecognizer does when it is configured for on-device operation. This transcriber does not support languages or locales that SFSpeechRecognizer only supports via network access.

Several transcriber instances can share the same backing engine instances and models, so long as the transcribers are configured similarly in certain respects.

Improve accuracy

You can bias recognition towards certain words, supply custom vocabulary, or adjust the transcriber’s algorithm to improve the transcriber’s accuracy.

To bias recognition towards certain words, create an AnalysisContext object and add those words to its contextualStrings property. Create a SpeechAnalyzer instance with that context object or set the analyzer’s context property.

To supply custom vocabulary, create an SFSpeechLanguageModel object and configure the transcriber with a corresponding customizedLanguage(modelConfiguration:) option.

To adjust the transcriber’s algorithm, configure the transcriber with relevant DictationTranscriber.ContentHint parameter. For example, you may use farField hint to improve accuracy of distant speech.

Topics

Creating a transcriber

Configuring transcription

Checking locale support

Getting results

See Also

Modules