selectedLocales
TypeScriptget selectedLocales(): Array<_Foundation_Locale>Swift declarationfinal var selectedLocales: [Locale] { get }The set of asset locales specified by the module's configuration.
class · iOS 26.0+ · SDK 27.1
final class DictationTranscriberA speech-to-text transcription module that's similar to system dictation features and compatible with older devices. 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 ``AnalysisContext/contextualStrings`` property. Create a ``SpeechAnalyzer`` instance with that context object or set the analyzer's ``SpeechAnalyzer/context`` property. To supply custom vocabulary, create an ``SFSpeechLanguageModel`` object and configure the transcriber with a corresponding ``ContentHint/customizedLanguage(modelConfiguration:)`` option. To adjust the transcriber's algorithm, configure the transcriber with relevant ``ContentHint`` parameter. For example, you may use ``ContentHint/farField`` hint to improve accuracy of distant speech.
get selectedLocales(): Array<_Foundation_Locale>Swift declarationfinal var selectedLocales: [Locale] { get }The set of asset locales specified by the module's configuration.
static supportedLocale(locale: _Foundation_Locale): Promise<(_Foundation_Locale) | null>Swift declarationstatic func supportedLocale(equivalentTo locale: Locale) async -> Locale?A locale from the module's supported locales equivalent to the given locale. Use this method to determine which of this module's supported locales is equivalent to an arbitrary locale such as `Locale.current`. If there is no exact equivalent, this method will return a near-equivalent: a supported (and by preference already-installed) locale that shares the same `Locale.LanguageCode` value but has a different `Locale.Region` value. This may result in an unexpected transcription, such as between "color" and "colour". - Tip: If you use this method, your application should ideally still provide a way for the user to correct the locale by selecting from the supported locales list. - Parameter locale: An arbitrary locale. - Returns: A locale in the supported locales list, or `nil` if there is no equivalent locale in that list.
static get installedLocales(): Promise<Array<_Foundation_Locale>>Swift declarationstatic var installedLocales: [Locale] { get async }The locales that the transcriber can transcribe into, considering only locales that are installed on the device.
static get supportedLocales(): Promise<Array<_Foundation_Locale>>Swift declarationstatic var supportedLocales: [Locale] { get async }The locales that the transcriber can transcribe into, including locales that may not be installed but are downloadable.
get availableCompatibleAudioFormats(): Promise<Array<_AVFAudio_AVAudioFormat>>Swift declarationfinal var availableCompatibleAudioFormats: [AVAudioFormat] { get async }The audio formats that this module is able to analyze, given its configuration. If the audio format doesn't matter, then there will be one format listed with a sample rate of `kAudioStreamAnyRate` and other values 0. If assets are necessary yet not installed on device, then the list will be empty. This property may be accessed before the module is added to the analyzer.
static initLocaleContentHintsTranscriptionOptionsReportingOptionsAttributeOptions(locale: _Foundation_Locale, contentHints: Array<DictationTranscriber_ContentHint>, transcriptionOptions: Array<DictationTranscriber_TranscriptionOption>, reportingOptions: Array<DictationTranscriber_ReportingOption>, attributeOptions: Array<DictationTranscriber_ResultAttributeOption>): DictationTranscriberSwift declarationconvenience init(locale: Locale, contentHints: Set<DictationTranscriber.ContentHint>, transcriptionOptions: Set<DictationTranscriber.TranscriptionOption>, reportingOptions: Set<DictationTranscriber.ReportingOption>, attributeOptions: Set<DictationTranscriber.ResultAttributeOption>)Creates a transcriber. - Parameters: - locale: A locale indicating a spoken and written language or script. - contentHints: A selection of expected characteristics of the spoken audio. - transcriptionOptions: A selection of options relating to the text of the transcription. - reportingOptions: A selection of options relating to the transcriber's result delivery. - attributeOptions: A selection of options relating to the attributes of the transcription.
static initLocalePreset(locale: _Foundation_Locale, preset: DictationTranscriber_Preset): DictationTranscriberSwift declarationconvenience init(locale: Locale, preset: DictationTranscriber.Preset)Creates a transcriber according to a preset. - Parameters: - locale: A locale indicating a spoken and written language or script. - preset: A structure that contains some transcriber options.
get results(): (SDKHandle) & (SDKHandle)Swift declarationfinal var results: some Sendable & AsyncSequence<DictationTranscriber.Result, any Error> { get }The asynchronous sequence of transcription results. Accessing this property does not create a new sequence.
No declarations were skipped in this snapshot.