SDK Reference · Type
STSRTask
Configures an individual speech-recognition task.
Overview
Use a recognition task to configure task-specific behavior and contextual information for speech recognition. Task configuration influences how the engine interprets speech, but it does not guarantee a particular hypothesis. Associate the task with the recognition call using the task identifier.
public struct STSRTask: Sendable {
public var taskID: String? = nil
public var taskHint: STSRTaskHint = .unspecified
public var reportPartialResults: Bool = true
public var addsPunctuation: Bool = false
public var contextualPhrases: [String: String]? = nil
}
taskID optionally identifies the task within the recognition configuration.
taskHint describes the expected recognition use case.
reportPartialResults controls delivery of interim recognition hypotheses. Default: true.
addsPunctuation requests automatic punctuation. Default: false.
contextualPhrases optionally supplies task-specific contextual phrases and pronunciation mappings.
Properties
taskID— Declared as String.taskHint— Declared asSTSRTaskHint.reportPartialResults— Declared as Bool.addsPunctuation— Declared as Bool.contextualPhrases— Declared as [.