Menu
Lumberyard
Developer Guide (Version 1.12)

Speech Recognition Player API

You can use the Speech Recognition Cloud Gem player API to send audio recordings or text to a bot for intent processing.

POST /service/postaudio

Sends an audio recording to a bot for intent processing. If the bot matches the recorded speech as an intent, it is returned with any necessary follow-up information. If the speech is not recognized, status information is returned. For information on the field formats and response parameters, see PostContent in the Amazon Lex Developer Guide.

Request Parameters

Name Type Description
user_id string Identifies the user to Amazon Lex for session tracking purposes.
bot_name string Name of the bot to use for intent matching.
bot_alias string Alias of the bot version to use for intent matching.
audio base64 string Base64 encoded 16-bit 16-kHz single channel audio PCM with a .wav header of recorded speech.
session_attributes string Contains information that is passed through to the response to allow metadata to appear in the response.

Response Parameters

Name Type Description
intent string If an intent is matched, contains the name of the intent.
dialog_state string The Amazon Lex interaction state. For more information, see PostContent in the Amazon Lex Developer Guide.
input_transcript string Transcript of the words that are recognized by Amazon Lex.
message string Status message to convey to user, if required.
session_attributes string Information passed from API parameters.
slots string The slot information that was recognized in the form of JSON name–value pairs.
slot_to_elicit string If slot information needs to be elicited, specifies the slot that the response state elicits.

POST /service/posttext

Sends text to a bot for intent processing. This is intended as a debugging function to help test the bot setup. You can also use the function for user-provided speech recognition. If the bot matches the recorded speech as an intent, it is returned with follow-up information if required. If the speech is not recognized, status information is returned. For information on field formats and response parameters, see PostContent in the Amazon Lex Developer Guide.

Request Parameters

Name Type Description
user_id string Identifies the user to Lex for session tracking purposes.
bot_name string Name of the bot to use for intent matching.
bot_alias string Alias of the bot version to use for intent matching.
text string Text to send for intent matching.
session_atrributes string Information to be passed through to the response to allow metadata to be in the response.

Response Parameters

The response parameters for posttext are the same as those for postaudio.