<!--
{
  "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/SFSpeechRecognizer/recognitionTask(with:delegate:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Speech"
    ],
    "preciseIdentifier" : "c:objc(cs)SFSpeechRecognizer(im)recognitionTaskWithRequest:delegate:"
  },
  "title" : "recognitionTask(with:delegate:)"
}
-->

# recognitionTask(with:delegate:)

Recognizes speech from the audio source associated with the specified request, using the specified delegate to manage the results.

```
func recognitionTask(with request: SFSpeechRecognitionRequest, delegate: any SFSpeechRecognitionTaskDelegate) -> SFSpeechRecognitionTask
```

## Parameters

`request`

A request (encapsulated in an [`SFSpeechRecognitionRequest`](/documentation/Speech/SFSpeechRecognitionRequest) object) to recognize speech from an audio source.

`delegate`

An object that can handle results from the speech recognition task. This object must conform to the [`SFSpeechRecognitionTaskDelegate`](/documentation/Speech/SFSpeechRecognitionTaskDelegate) protocol.

## Return Value

The task object you can use to manage an in-progress recognition request.

## Discussion

Use this method to initiate the speech recognition process on the audio contained in the request object. This method executes asynchronously and returns a [`SFSpeechRecognitionTask`](/documentation/Speech/SFSpeechRecognitionTask) object that you can use to cancel or finalize the recognition process later. As results become available, the method calls the methods of the provided `delegate` object.

Note that the [`SFSpeechRecognitionTask`](/documentation/Speech/SFSpeechRecognitionTask) object returned by this method does not retain your delegate object. You must maintain a strong reference to your delegate while speech recognition is in progress.

---

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)