HERE Android SDK Developer's Guide

SpeechToTextProvider

The interface SpeechToTextProvider is a member of com.here.android.mpa.nlp .

Interface Summary

public abstract interface SpeechToTextProvider

Speech to text interface for start or stop listening for voice commands, cancel, pause, resume or destroy the Speech recognition service.

[For complete information, see the section Interface Details]

Method Summary

Table 1. Methods in SpeechToTextProvider
Methods

public abstract void cancel ()

Cancel the speech recognition.

public abstract void destroy ()

Destroy the speech recognizer object.

public abstract boolean isListening ()

Return whether the ASR is currently listening to speech.

public abstract void pause ()

Pause ASR functionality (when Activity onPause event is called and pause() is used.

public abstract void resume (Context context)

Resume ASR functionality (when Activity onResume event is called) and resume(Context) is used.

public abstract void start ()

Start listening for speech.

public abstract boolean stop ()

Stop listening for speech.

Interface Details

Speech to text interface for start or stop listening for voice commands, cancel, pause, resume or destroy the Speech recognition service. If this interface is not implemented, the speech recognition service is entirely the responsibility of the application. Calling Speech recognition service APIs like startListening() or stopListening() would not do anything and Nlp would not be able to make sure no other voice is playing (e.g. navigation instructions) while the ASR is listening. To achieve better user experience, it's highly recommended that the application implements this interface and uses Nlp APIs: startListening(), stopListening(), resume(Context), pause().

IMPORTANT: Natural language processor is a Beta feature. The related classes are subject to change without notice.

Method Details

public abstract void cancel ()

Cancel the speech recognition.

public abstract void destroy ()

Destroy the speech recognizer object.

public abstract boolean isListening ()

Return whether the ASR is currently listening to speech. It is listening if ASR was started and results haven't been received yet.

Returns:

boolean: true of the ASR is currently listening to speech false otherwise.

public abstract void pause ()

Pause ASR functionality (when Activity onPause event is called and pause() is used.

public abstract void resume (Context context)

Resume ASR functionality (when Activity onResume event is called) and resume(Context) is used.

Parameters:

public abstract void start ()

Start listening for speech.

public abstract boolean stop ()

Stop listening for speech.