-
public class SpeechStreamServiceService that recognizes stream audio in a thread, passes it to a recognizer and emits recognition results. Recognition events are passed to a client using RecognitionListener
-
-
Constructor Summary
Constructors Constructor Description SpeechStreamService(Recognizer recognizer, InputStream inputStream, float sampleRate)Creates speech service.
-
Method Summary
Modifier and Type Method Description booleanstart(RecognitionListener listener)Starts recognition. booleanstart(RecognitionListener listener, int timeout)Starts recognition. booleanstop()Stops recognition. -
-
Constructor Detail
-
SpeechStreamService
SpeechStreamService(Recognizer recognizer, InputStream inputStream, float sampleRate)
Creates speech service.
-
-
Method Detail
-
start
boolean start(RecognitionListener listener)
Starts recognition. Does nothing if recognition is active.
-
start
boolean start(RecognitionListener listener, int timeout)
Starts recognition. After specified timeout listening stops and theendOfSpeech signals about that. Does nothing if recognition is active.
timeout - timeout in milliseconds to listen.
-
stop
boolean stop()
Stops recognition. All listeners should receive final result if there isany. Does nothing if recognition is not active.
-
-
-
-