SpeechProcessor

@objc
public protocol SpeechProcessor : AnyObject

Protocol for speech pipeline components to receive speech pipeline coordination events.

startStreaming and stopStreaming are expected to be called repeatedly while the pipeline is running, and should respond to these functions by allocating and deallocating resources in order to optimize performance.

  • The global configuration for all speech pipeline components.

    Declaration

    Swift

    @objc
    var configuration: SpeechConfiguration { get set }
  • Global speech context.

    Declaration

    Swift

    @objc
    var context: SpeechContext { get set }
  • Trigger from the speech pipeline for the component to begin processing the audio stream.

    Declaration

    Swift

    @objc
    func startStreaming()

    Parameters

    context

    The current speech context.

  • Trigger from the speech pipeline for the component to stop processing the audio stream.

    Declaration

    Swift

    @objc
    func stopStreaming()
  • Receives a frame of audio samples for processing. Interface between the SpeechProcessor and AudioController components.

    Declaration

    Swift

    @objc
    func process(_ frame: Data)

    Parameters

    frame

    Audio frame of samples.