Contents

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.

Declaration

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 property to start, stop, or otherwise manage the capture session.

See Also

Creating a provider