public class InteractiveVoiceViewAdapter extends java.lang.Object implements InteractionListener, AudioPlaybackListener, MicrophoneListener, android.view.View.OnClickListener
InteractiveVoiceView view's
with the Amazon Lex client. It manages the client states and delivers results
through separate callbacks. This implementation of the adapter offers only
voice for voice out operations only.| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAwsRegion()
Get the AWS regions set for this adapter.
|
static InteractiveVoiceViewAdapter |
getInstance(android.content.Context context,
InteractiveVoiceView micButton) |
void |
onAudioPlayBackCompleted()
Called after audio playback ends.
|
void |
onAudioPlaybackError(java.lang.Exception e)
Called when audion playback fails.
|
void |
onAudioPlaybackStarted()
Called when audio playback has started.
|
void |
onClick(android.view.View v) |
void |
onInteractionError(Response response,
java.lang.Exception e)
This method is invoked on error.
|
void |
onMicrophoneError(java.lang.Exception e)
Indicates an error when recording sound on the microphone.
|
void |
onReadyForFulfillment(Response response)
This is invoked when all information required to fulfill a transaction
has been recovered.
|
void |
onRecordingEnd()
This is invoked when the client has stopped recording.
|
void |
onSoundLevelChanged(double soundLevel)
This is invoked to indicate a change in the sound level.
|
void |
promptUserToRespond(Response response,
LexServiceContinuation continuation)
This is invoked when input is required from the user.
|
void |
readyForRecording()
This is invoked when the client is ready for recording.
|
void |
setAwsRegion(java.lang.String awsRegion)
Set the AWS region where the Amazon Lex bot has been setup.
|
void |
setCredentialProvider(AWSCredentialsProvider credentialsProvider)
Set credentials provider.
|
void |
setInteractionConfig(InteractionConfig interactionConfig)
Set interaction config.
|
void |
setSessionAttributes(java.util.Map<java.lang.String,java.lang.String> sessionAttributes)
Set session attributes, these will be picked for the next dialog transaction.
|
void |
startedRecording()
This is invoked when the client has started recording.
|
public static InteractiveVoiceViewAdapter getInstance(android.content.Context context, InteractiveVoiceView micButton)
public void onAudioPlaybackStarted()
AudioPlaybackListeneronAudioPlaybackStarted in interface AudioPlaybackListenerpublic void onAudioPlayBackCompleted()
AudioPlaybackListeneronAudioPlayBackCompleted in interface AudioPlaybackListenerpublic void onAudioPlaybackError(java.lang.Exception e)
AudioPlaybackListeneronAudioPlaybackError in interface AudioPlaybackListenere - Exception.public void onReadyForFulfillment(Response response)
InteractionListeneronReadyForFulfillment in interface InteractionListenerresponse - Response, contains the service
response.public void promptUserToRespond(Response response, LexServiceContinuation continuation)
InteractionListenerpromptUserToRespond in interface InteractionListenerresponse - Response, contains the service
response.continuation - LexServiceContinuation, allows to
continue with the current transaction.public void onInteractionError(Response response, java.lang.Exception e)
InteractionListeneronInteractionError in interface InteractionListenerresponse - Response, contains the service
response.e - error reported as Exception.public void readyForRecording()
MicrophoneListenerreadyForRecording in interface MicrophoneListenerpublic void startedRecording()
MicrophoneListenerstartedRecording in interface MicrophoneListenerpublic void onRecordingEnd()
MicrophoneListeneronRecordingEnd in interface MicrophoneListenerpublic void onSoundLevelChanged(double soundLevel)
MicrophoneListeneronSoundLevelChanged in interface MicrophoneListenersoundLevel - Sound level as a Double.public void onMicrophoneError(java.lang.Exception e)
MicrophoneListeneronMicrophoneError in interface MicrophoneListenere - Error as an Exception.public void onClick(android.view.View v)
onClick in interface android.view.View.OnClickListenerpublic void setCredentialProvider(AWSCredentialsProvider credentialsProvider)
credentialsProvider - public void setInteractionConfig(InteractionConfig interactionConfig)
interactionConfig - The interaction config.public void setSessionAttributes(java.util.Map<java.lang.String,java.lang.String> sessionAttributes)
sessionAttributes - public void setAwsRegion(java.lang.String awsRegion)
awsRegion - public java.lang.String getAwsRegion()
String.Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.