@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.
Initializes a new speech pipeline instance. For use by clients wishing to pass 3rd-party stages to the spokestack pipeline.
ImportantMost clients should use
SpeechPipelineBuilderto initialize a new speech pipeline instance, not this initializer.
Configuration parameters for the speech pipeline.
Delegate implementations of
SpokestackDelegatethat receive speech pipeline events.
SpeechProcessorinstances process audio frames from
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.
@objc public func activate()
Deactivates speech recognition. The pipeline returns to awaiting either wakeword activation or an explicit
@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
@objc public func start()
Stops the speech pipeline.
All pipeline activity is stopped, and the pipeline cannot be activated until it is
@objc public func stop()