public static final class SpeechPipeline.Builder extends Object
Constructor and Description |
---|
Builder()
initializes a new builder instance.
|
Modifier and Type | Method and Description |
---|---|
SpeechPipeline.Builder |
addOnSpeechEventListener(OnSpeechEventListener listen)
adds a pipeline event listener.
|
SpeechPipeline.Builder |
addStageClass(String value)
adds a single pipeline stage component class name.
|
SpeechPipeline |
build()
creates and initializes the speech pipeline.
|
SpeechPipeline.Builder |
setAndroidContext(android.content.Context androidContext)
Sets the android context for the pipeline.
|
SpeechPipeline.Builder |
setConfig(SpeechConfig value)
attaches a pipeline configuration object.
|
SpeechPipeline.Builder |
setInputClass(String value)
sets the class name of the audio input component.
|
SpeechPipeline.Builder |
setProperty(String key,
Object value)
sets a pipeline configuration value.
|
SpeechPipeline.Builder |
setStageClasses(List<String> value)
sets the class names of the pipeline stage components in bulk.
|
SpeechPipeline.Builder |
useProfile(String profileClass)
applies configuration from a
PipelineProfile to the current
builder, returning the modified builder. |
public SpeechPipeline.Builder setInputClass(String value)
value
- input component class namepublic SpeechPipeline.Builder setStageClasses(List<String> value)
value
- list of pipeline component namespublic SpeechPipeline.Builder addStageClass(String value)
value
- stage component class namepublic SpeechPipeline.Builder setConfig(SpeechConfig value)
value
- configuration to attachpublic SpeechPipeline.Builder setAndroidContext(android.content.Context androidContext)
androidContext
- the android context for the pipeline.AndroidSpeechRecognizer
public SpeechPipeline.Builder setProperty(String key, Object value)
key
- configuration property namevalue
- property valuepublic SpeechPipeline.Builder useProfile(String profileClass) throws IllegalArgumentException
PipelineProfile
to the current
builder, returning the modified builder. subsequent calls to useProfile
or setProperty
can override configuration set by
a profile.profileClass
- class name of the profile to apply.IllegalArgumentException
- if the specified profile does not
existpublic SpeechPipeline.Builder addOnSpeechEventListener(OnSpeechEventListener listen)
listen
- listener callbackpublic SpeechPipeline build()
Copyright © 2020. All rights reserved.