public abstract static class Transaction.Listener extends Object
Constructor and Description |
---|
Listener() |
Modifier and Type | Method and Description |
---|---|
void |
onAudio(Transaction transaction,
Audio audio)
Called when the Transaction returns audio data.
|
void |
onError(Transaction transaction,
String suggestion,
TransactionException e)
Called when the Transaction has an error.
|
void |
onFinishedRecording(Transaction transaction)
Called when the Transaction stops recording audio.
|
void |
onInterpretation(Transaction transaction,
Interpretation interpretation)
Called when the Transaction receives an interpretation.
|
void |
onRecognition(Transaction transaction,
Recognition recognition)
Called when the Transaction receives a text recognition.
|
void |
onServiceResponse(Transaction transaction,
org.json.JSONObject response)
Called when the Transaction returns a custom application response.
|
void |
onStartedRecording(Transaction transaction)
Called when the Transaction starts recording audio.
|
void |
onSuccess(Transaction transaction,
String suggestion)
Called when the Transaction completes successfully.
|
public void onStartedRecording(Transaction transaction)
transaction
- The Transaction which started the audio recording.public void onFinishedRecording(Transaction transaction)
transaction
- The Transaction which finished the audio recording.public void onRecognition(Transaction transaction, Recognition recognition)
transaction
- The Transaction on which the recognition happened.recognition
- The Recognition result.public void onInterpretation(Transaction transaction, Interpretation interpretation)
transaction
- The Transaction on which the Interpretation happened.interpretation
- The Interpretation result.public void onServiceResponse(Transaction transaction, org.json.JSONObject response)
transaction
- The Transaction on which the service transaction happened.response
- The service response in JSON format.public void onAudio(Transaction transaction, Audio audio)
transaction
- The Transaction which received the new Audio.audio
- The Audio which was created or updated with new content.public void onSuccess(Transaction transaction, String suggestion)
transaction
- The Transaction which successfully completed.suggestion
- A suggestion to further optimize the Transaction (might be null)public void onError(Transaction transaction, String suggestion, TransactionException e)
transaction
- The Transaction that the error occurred on.suggestion
- A suggestion for why the error occurred.e
- The error.