public abstract class AIService
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected AIDataService |
aiDataService |
protected AIConfiguration |
config |
protected android.content.Context |
context |
| Modifier | Constructor and Description |
|---|---|
protected |
AIService(AIConfiguration config,
android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
cancel()
Cancel listening process and don't request to AI service
|
static AIService |
getService(android.content.Context context,
AIConfiguration config)
Use this method to get ready to work instance
|
protected void |
onAudioLevelChanged(float audioLevel) |
protected void |
onError(AIError error) |
protected void |
onListeningFinished() |
protected void |
onListeningStarted() |
protected void |
onResult(AIResponse response) |
void |
pause() |
void |
resume() |
void |
setListener(AIListener listener)
Sets listener, which used to notify about process steps
|
abstract void |
startListening()
Starts listening process
|
abstract void |
startListening(java.util.List<AIContext> contexts)
Starts listening process.
|
abstract void |
stopListening()
Stop listening and start request to the AI service with current recognition results
|
AIResponse |
textRequest(AIRequest request) |
protected final AIConfiguration config
protected final android.content.Context context
protected final AIDataService aiDataService
protected AIService(AIConfiguration config, android.content.Context context)
public static AIService getService(android.content.Context context, AIConfiguration config)
context - config - public abstract void startListening()
public abstract void startListening(java.util.List<AIContext> contexts)
public abstract void stopListening()
public abstract void cancel()
public void setListener(AIListener listener)
listener - AIListener implementationprotected void onResult(AIResponse response)
protected void onError(AIError error)
protected void onAudioLevelChanged(float audioLevel)
protected void onListeningStarted()
protected void onListeningFinished()
public void pause()
public void resume()
public AIResponse textRequest(AIRequest request) throws AIServiceException
AIServiceException