Reads from an AV capture device such as a microphone, providing the captured audio in a format suitable for analysis by a speech analyzer.
Members (6)
get · iOS 27.0+
analyzerInputs
TypeScript
get analyzerInputs(): (SDKHandle) & (SDKHandle)
Swift declaration
final var analyzerInputs: some Sendable & AsyncSequence<AnalyzerInput, any Error> { get }
A new sequence of speech analyzer input objects containing captured audio.
The sequence includes only newly captured audio.
You may release the provider object after obtaining the sequence. The sequence terminates when you deallocate the audio data output, which typically happens when you deallocate the capture session and this provider.
get · iOS 27.0+
captureSession
TypeScript
get captureSession(): _AVFoundation_AVCaptureSession
Swift declaration
final var captureSession: AVCaptureSession { get }
The underlying capture session.
This property's value is the new capture session created by ``providerWithSession(from:compatibleWith:priority:)`` or the existing capture session passed to ``provider(from:in:compatibleWith:priority:)`` or the initializer.
Use the methods of `AVCaptureSession` to start, stop, or manage the capture session.
Returns an input sequence provider that reads from an audio capture device, and configures a new audio capture session with that device.
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.
- Note: On iOS, tvOS, visionOS, and watchOS platforms, this method automatically configures your application's default `AVAudioSession`. To avoid this behavior, call ``provider(from:in:compatibleWith:priority:)`` instead.
- 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.
- Returns: An instance of this class.
get · iOS 27.0+
captureAudioDataOutput
TypeScript
get captureAudioDataOutput(): _AVFoundation_AVCaptureAudioDataOutput
Swift declaration
final var captureAudioDataOutput: AVCaptureAudioDataOutput { get }
An audio data output that routes and converts captured audio buffers to async sequences.
Add this output to an existing capture session. Calling ``providerWithSession(from:compatibleWith:priority:)`` automatically adds this output to the session it creates.
Do not modify the output's sample buffer delegate or callback queue.
Creates an input sequence provider.
This initializer also creates an `AVCaptureAudioDataOutput` object suitable for adding to the given `AVCaptureSession`. It does not reconfigure or alter the session.
Use the ``captureAudioDataOutput`` property to access the output object and add it to your session.
- Parameters:
- session: The capture session that manages the audio capture operation.
- analyzerFormat: The audio format to convert the audio samples to. The audio format should be one supported by the speech analyzer's modules.
- priority: The desired priority of the audio-capture task.
Returns an input sequence provider that reads from an audio capture device.
This method also creates an `AVCaptureAudioDataOutput` object suitable for adding to an existing `AVCaptureSession`. It does not reconfigure or alter the session.
Use the ``captureAudioDataOutput`` property to access the output object and add it to your session.
- Parameters:
- captureDevice: The capture device to use.
- session: The capture session that manages the audio capture operation.
- modules: The speech modules that will analyze the audio.
- priority: The desired priority of the audio-capture task.
- Returns: An instance of this class.