<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Speech",
  "identifier" : "/documentation/Speech/CaptureInputSequenceProvider/providerWithSession(from:compatibleWith:priority:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Speech"
    ],
    "preciseIdentifier" : "s:6Speech28CaptureInputSequenceProviderC19providerWithSession4from010compatibleG08priorityACSo15AVCaptureDeviceC_SayAA0A6Module_pGScPSgtYaKFZ"
  },
  "title" : "providerWithSession(from:compatibleWith:priority:)"
}
-->

# providerWithSession(from:compatibleWith:priority:)

Returns an input sequence provider that reads from an audio capture device, and configures a new audio capture session with that device.

```
static func providerWithSession(from captureDevice: AVCaptureDevice, compatibleWith modules: [any SpeechModule], priority: TaskPriority? = nil) async throws -> CaptureInputSequenceProvider
```

## Parameters

`captureDevice`

The capture device to use.

`modules`

The speech modules that will analyze the audio.

`priority`

The desired priority of the audio-capture task.

## Return Value

An instance of this class.

## Discussion

This method also creates and configures a new `AVCaptureSession` with default settings. Initializing a session can take some time; you should call this method in a background task.

Use the [`captureSession`](/documentation/Speech/CaptureInputSequenceProvider/captureSession) property to start, stop, or otherwise manage the capture session.

> Note: On iOS, tvOS, visionOS, and watchOS platforms, this method automatically configures your application’s default `AVAudioSession`. To avoid this behavior, call ``doc://com.apple.speech/documentation/Speech/CaptureInputSequenceProvider/provider(from:in:compatibleWith:priority:)`` instead.

---

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)