Contents

SpeechTranscriber.Preset

Predefined transcriber configurations.

Declaration

struct Preset

Overview

You can configure a transcriber with a preset, or modify the values of a preset’s properties and configure a transcriber with the modified values. You can also create your own presets by extending this type.

It is not necessary to use a preset at all; you can also use the transcriber’s designated initializer to completely customize its configuration.

This example configures a transcriber according to the timeIndexedTranscriptionWithAlternatives preset, but adds etiquette filtering and removes alternative transcriptions:

let preset = SpeechTranscriber.Preset.timeIndexedTranscriptionWithAlternatives
let transcriber = SpeechTranscriber(
    locale: Locale.current,
    transcriptionOptions: preset.transcriptionOptions.union([.etiquetteReplacements])
    reportingOptions: preset.reportingOptions.subtracting([.alternativeTranscriptions])
    attributeOptions: preset.attributeOptions
)

This table lists the presets and their configurations:

Preset

Volatileresults

Fastresults

Alternativetranscriptions

Audiotimerange

transcription

No

No

No

No

transcriptionWithAlternatives

No

No

Yes

No

timeIndexedTranscriptionWithAlternatives

No

No

Yes

Yes

progressiveTranscription

Yes

Yes

No

No

timeIndexedProgressiveTranscription

Yes

Yes

No

Yes

Topics

Standard presets

Creating a preset

Getting preset properties

See Also

Creating a transcriber