SpeechPipeline

@objc
public final class SpeechPipeline : NSObject

This is the primary client entry point to the Spokestack voice input system. It dynamically binds to configured components that implement the pipeline interfaces for reading audio frames and performing speech recognition tasks.

The pipeline may be stopped/restarted any number of times during its lifecycle. While stopped, the pipeline consumes as few resources as possible. The pipeline runs asynchronously on a dedicated thread, so it does not block the caller when performing I/O and speech processing.

When running, the pipeline communicates with the client via delegates that receive events.

Public (properties)

Initializers

  • Initializes a new speech pipeline instance. For use by clients wishing to pass 3rd-party stages to the spokestack pipeline.

    Important

    Most clients should use SpeechPipelineBuilder to initialize a new speech pipeline instance, not this initializer.

    See also

    SpeechPipelineBuilder

    Declaration

    Swift

    @objc
    public init(configuration: SpeechConfiguration, listeners: [SpeechEventListener], stages: [SpeechProcessor], context: SpeechContext)

    Parameters

    configuration

    Configuration parameters for the speech pipeline.

    listeners

    Delegate implementations of SpeechEventListener that receive speech pipeline events.

    stages

    SpeechProcessor instances process audio frames from AudioController.

  • Activates speech recognition. The pipeline remains active until the user stops talking or the activation timeout is reached.

    Activations have configurable minimum/maximum lengths. The minimum length prevents the activation from being aborted if the user pauses after saying the wakeword (which deactivates the VAD). The maximum activation length allows the activation to timeout if the user doesn’t say anything after saying the wakeword.

    The wakeword detector can be used in a multi-turn dialogue system. In such an environment, the user is not expected to say the wakeword during each turn. Therefore, an application can manually activate the pipeline by calling activate (after a system turn), and the wakeword detector will apply its minimum/maximum activation lengths to control the duration of the activation.

    Declaration

    Swift

    @objc
    public func activate()
  • Deactivates speech recognition. The pipeline returns to awaiting either wakeword activation or an explicit activate call.

    See also

    activate

    Declaration

    Swift

    @objc
    public func deactivate()
  • Starts the speech pipeline.

    The pipeline starts in a deactivated state, awaiting either a triggered activation from a wakeword or VAD, or an explicit call to activate.

    Declaration

    Swift

    @objc
    public func start()
  • Stops the speech pipeline.

    All pipeline activity is stopped, and the pipeline cannot be activated until it is started again.

    Declaration

    Swift

    @objc
    public func stop()