A part of the entire hypothesized transcription.


class SFTranscriptionSegment : NSObject


Use an SFTranscriptionSegment object to get details about a portion of an overall transcription. You do not create transcription object segments directly. Instead, they are created for you and delivered in the SFTranscription object that is included with any speech recognition results.

Each transcription segment includes the following information:

  • The text of the segment, plus any alternative interpretations of the spoken word.

  • The character range of the segment within the formattedString of its parent SFTranscription object.

  • A confidence value, indicating how likely the specified string matches the audible speech.

  • A timestamp and duration value, indicating the position of the segment within the provided audio stream.


Getting the Segment's Recognized Text

var substring: String

The string representation of the utterance in this transcription segment.

var substringRange: NSRange

The range information for this transcription segment's substring, relative to the overall hypothesized transcription.

var alternativeSubstrings: [String]

An array of alternate interpretations of the utterance in this transcription segment.

Getting the Recognition Confidence Level

var confidence: Float

The level of confidence in the accuracy of the recognition for this transcription segment.

Getting the Audio Timing Information

var timestamp: TimeInterval

The start time of the segment in the processed audio stream.

var duration: TimeInterval

The number of seconds it took for the user to say the word represented by the segment, measured from the start of the utterance.


Inherits From

See Also

Transcription Results

class SFSpeechRecognitionResult

An object containing the partial or final results of a speech recognition request.

class SFTranscription

A textual representation of the recognized speech.