<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 10.0.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Speech",
  "identifier" : "/documentation/Speech/SFSpeechRecognitionTask",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Speech"
    ],
    "preciseIdentifier" : "c:objc(cs)SFSpeechRecognitionTask"
  },
  "title" : "SFSpeechRecognitionTask"
}
-->

# SFSpeechRecognitionTask

A task object for monitoring the speech recognition progress.

```
class SFSpeechRecognitionTask
```

## Overview

Use an `SFSpeechRecognitionTask` object to determine the state of a speech recognition task, to cancel an ongoing task, or to signal the end of the task.

You don’t create speech recognition task objects directly. Instead, you receive one of these objects after calling [`recognitionTask(with:resultHandler:)`](/documentation/Speech/SFSpeechRecognizer/recognitionTask(with:resultHandler:)) or [`recognitionTask(with:delegate:)`](/documentation/Speech/SFSpeechRecognizer/recognitionTask(with:delegate:)) on your [`SFSpeechRecognizer`](/documentation/Speech/SFSpeechRecognizer) object.

## Topics

### Canceling a speech recognition task

[`cancel()`](/documentation/Speech/SFSpeechRecognitionTask/cancel())

Cancels the current speech recognition task.

[`isCancelled`](/documentation/Speech/SFSpeechRecognitionTask/isCancelled)

A Boolean value that indicates whether the speech recognition task was canceled.

### Finishing a speech recognition task

[`finish()`](/documentation/Speech/SFSpeechRecognitionTask/finish())

Stops accepting new audio and finishes processing on the audio input that has already been accepted.

[`isFinishing`](/documentation/Speech/SFSpeechRecognitionTask/isFinishing)

A Boolean value that indicates whether audio input has stopped.

### Monitoring recognition progress

[`state`](/documentation/Speech/SFSpeechRecognitionTask/state)

The current state of the speech recognition task.

[`SFSpeechRecognitionTaskState`](/documentation/Speech/SFSpeechRecognitionTaskState)

The state of the task associated with the recognition request.

[`error`](/documentation/Speech/SFSpeechRecognitionTask/error)

An error object that specifies the error that occurred during a speech recognition task.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)