STSRParams
Groups configuration for a speech-recognition session.
Overview
Groups the speech-recognition task, continuous-recognition behavior, and the on-device recognition requirement. When on-device recognition is required, an unsupported or unavailable on-device recognizer causes the request to fail; recognition must not silently fall back to a server-based recognizer.
public struct STSRParams: Sendable {
public var srTask: STSRTask? = nil
public var requiresOnDeviceRecognition: Bool = false
}
srTask optionally supplies task-specific recognition behavior.
requiresOnDeviceRecognition — Default: false. When true, on-device recognition is mandatory. If the selected recognizer or device does not support on-device recognition, the recognition request fails; there is no automatic server-based fallback. When false, on-device recognition is not mandatory and the recognition engine may use server-based recognition according to its capabilities and configuration.
The requirement is significant for permission/capability handling: when on-device recognition is not required, the current runner may also require permission for cloud recognition.
Properties
srTask— Declared asSTSRTask.requiresOnDeviceRecognition— Boolean, defaultfalse. If enabled, requires on-device speech recognition and rejects recognition when it is unavailable; no cloud fallback.
Where this type is used
STMediaRunner.recognizeDeviceAudioSTMediaRunner.recognizeFileAudioSTMediaRunner.recognizeFileAudioDirect