SDK Reference · Type
STSpeechRecognitionStopMode
Specifies how an active recognition operation should stop.
Overview
Choose how an in-progress recognition task is stopped. The stop mode determines the requested shutdown behavior; the return from the stop call does not itself establish that recognition has finished. Observe the recognition completion event for the actual outcome.
public enum STSpeechRecognitionStopMode: Sendable {
case finish
case cancel
}
finish requests normal recognition completion and allows an available final hypothesis to be returned.
cancel cancels the recognition operation.
Cases
.finish— Finish option..cancel— Cancel option.
Swift example
let selection: STSpeechRecognitionStopMode = .finish