public final class SpokestackCloudRecognizer extends Object implements SpeechProcessor
This pipeline component streams audio samples to Spokestack's cloud-based ASR service for speech recognition. When the speech context is triggered, the recognizer begins streaming buffered frames to the API for recognition. Once the speech context becomes inactive, the recognizer completes the API request and raises a RECOGNIZE event along with the audio transcript and confidence.
The Spokestack recognizer supports the following configuration properties:
Constructor and Description |
---|
SpokestackCloudRecognizer(SpeechConfig speechConfig)
initializes a new recognizer instance.
|
SpokestackCloudRecognizer(SpeechConfig speechConfig,
SpokestackCloudClient.Builder builder)
initializes a new recognizer instance, useful for testing.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
releases the resources associated with the recognizer.
|
void |
process(SpeechContext speechContext,
ByteBuffer frame)
processes a frame of audio.
|
void |
reset()
resets all state internal to the stage.
|
public SpokestackCloudRecognizer(SpeechConfig speechConfig)
speechConfig
- Spokestack speech configurationpublic SpokestackCloudRecognizer(SpeechConfig speechConfig, SpokestackCloudClient.Builder builder)
speechConfig
- Spokestack speech configurationbuilder
- speech client builderpublic void reset()
SpeechProcessor
reset
in interface SpeechProcessor
public void close()
close
in interface AutoCloseable
public void process(SpeechContext speechContext, ByteBuffer frame)
process
in interface SpeechProcessor
speechContext
- the current speech contextframe
- the audio frame to detectCopyright © 2021. All rights reserved.