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()
AudioPlaybackListener
onAudioPlaybackStarted
in interface AudioPlaybackListener
public void onAudioPlayBackCompleted()
AudioPlaybackListener
onAudioPlayBackCompleted
in interface AudioPlaybackListener
public void onAudioPlaybackError(java.lang.Exception e)
AudioPlaybackListener
onAudioPlaybackError
in interface AudioPlaybackListener
e
- Exception
.public void onReadyForFulfillment(Response response)
InteractionListener
onReadyForFulfillment
in interface InteractionListener
response
- Response
, contains the service
response.public void promptUserToRespond(Response response, LexServiceContinuation continuation)
InteractionListener
promptUserToRespond
in interface InteractionListener
response
- Response
, contains the service
response.continuation
- LexServiceContinuation
, allows to
continue with the current transaction.public void onInteractionError(Response response, java.lang.Exception e)
InteractionListener
onInteractionError
in interface InteractionListener
response
- Response
, contains the service
response.e
- error reported as Exception
.public void readyForRecording()
MicrophoneListener
readyForRecording
in interface MicrophoneListener
public void startedRecording()
MicrophoneListener
startedRecording
in interface MicrophoneListener
public void onRecordingEnd()
MicrophoneListener
onRecordingEnd
in interface MicrophoneListener
public void onSoundLevelChanged(double soundLevel)
MicrophoneListener
onSoundLevelChanged
in interface MicrophoneListener
soundLevel
- Sound level as a Double
.public void onMicrophoneError(java.lang.Exception e)
MicrophoneListener
onMicrophoneError
in interface MicrophoneListener
e
- Error as an Exception
.public void onClick(android.view.View v)
onClick
in interface android.view.View.OnClickListener
public 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.