public class AzureSpeechRecognizer extends Object implements SpeechProcessor
This component implements the speech processor interface using the Azure Speech 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 raises a RECOGNIZE event along with the audio transcript. Unfortunately, the Azure Speech SDK currently doesn't return confidence values alongside transcripts, so confidence is always set to 1.0.
Use of the Azure Speech Service implies acceptance of Microsoft's license terms, which can be found here.
This pipeline component requires the following configuration properties:
Constructor and Description |
---|
AzureSpeechRecognizer(SpeechConfig speechConfig)
initializes a new recognizer instance.
|
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 AzureSpeechRecognizer(SpeechConfig speechConfig)
speechConfig
- Spokestack speech configurationpublic void reset()
SpeechProcessor
reset
in interface SpeechProcessor
public void close()
close
in interface AutoCloseable
public void process(SpeechContext speechContext, ByteBuffer frame) throws Exception
process
in interface SpeechProcessor
speechContext
- the current speech contextframe
- the audio frame to detectException
- if there is an error performing active recognition.Copyright © 2020. All rights reserved.