SpeechPipelineBuilder
@objc
public class SpeechPipelineBuilder : NSObject
Convenience initializer for building a SpeechPipeline instance using a pre-configured profile. A pipeline profile encapsulates a series of configuration values tuned for a specific task.
Profiles are not authoritative; they act just like calling a series of methods on a SpeechPipelineBuilder, and any configuration properties they set can be overridden by subsequent calls.
- Example:
// assume that self implements the SpeechEventListener protocol let pipeline = SpeechPipelineBuilder() .addListener(self) .setDelegateDispatchQueue(DispatchQueue.main) .useProfile(.tfLiteWakewordAppleSpeech) .setProperty("tracing", Trace.Level.PERF) .setProperty("detectModelPath", detectPath) .setProperty("encodeModelPath", encodePath) .setProperty("filterModelPath", filterPath) .build() pipeline.start()
-
Applies configuration from
SpeechPipelineProfilesto the current builder, returning the modified builder.Declaration
Swift
@objc public func useProfile(_ profile: SpeechPipelineProfiles) -> SpeechPipelineBuilderParameters
profileName of the profile to apply.
Return Value
An updated instance of
SpeechPipelineBuilderfor call chaining. -
Sets a
SpeechConfigurationconfiguration value.See also
SpeechConfigurationDeclaration
Swift
@objc public func setProperty(_ key: String, _ value: Any) -> SpeechPipelineBuilderParameters
keyConfiguration property name
valueConfiguration property value
Return Value
An updated instance of
SpeechPipelineBuilderfor call chaining. -
Replaces the default speech configuration with the specified configuration.
Warning
All preceedingsetPropertycalls will be erased by setting the configuration explicitly.Declaration
Swift
@objc public func setConfiguration(_ config: SpeechConfiguration) -> SpeechPipelineBuilderParameters
configAn instance of SpeechConfiguration that the pipeline will use.
-
Delegate events will be sent using the specified dispatch queue.
See also
SpeechConfigurationDeclaration
Swift
@objc public func setDelegateDispatchQueue(_ queue: DispatchQueue) -> SpeechPipelineBuilderParameters
queueA
DispatchQueueinstanceReturn Value
An updated instance of
SpeechPipelineBuilderfor call chaining. -
Delegate events will be sent to the specified listener.
Declaration
Swift
@objc public func addListener(_ listener: SpokestackDelegate) -> SpeechPipelineBuilderParameters
listenerA
SpeechEventListenerinstance.Return Value
An updated instance of
SpeechPipelineBuilderfor instace function call chaining. -
Build this configuration into a
SpeechPipelineinstance.Declaration
Swift
@objc public func build() throws -> SpeechPipelineReturn Value
A
SpeechPipelineinstance.
View on GitHub
SpeechPipelineBuilder Class Reference