Home > Alexa > Alexa Voice Service

Recognize Speech Request

Requests


Speechrecognizer Requests

Recognize Speech Request

Responses

Speechrecognizer Responses

Recognize Speech Response

HTTP Request

The Recognize Speech method takes the audio input from the user and responds with synthesized-voice audio.

Initial Request

The following example presents the Recognize Speech request:

POST /v1/avs/speechrecognizer/recognize HTTP/1.1

Host: access-alexa-na.amazon.com
Authorization: Bearer xxxxxxxxxxxx
Content-Type: multipart/form-data; boundary=boundary_term
Transfer-Encoding: chunked

--boundary_term
Content-Disposition: form-data; name="request"
Content-Type: application/json; charset=UTF-8

{
    "messageHeader": {
        "deviceContext": [
            {
                "name":"playbackState",
                "namespace":"AudioPlayer"
                "payload": {
                    "streamId": "xxxxxxxxxxxx",
                    "offsetInMilliseconds": xxxxxxxxxxxx,
                    "playerActivity": "xxxxxxxxxxxx"
                }
            },
            {
                ...
            },
            ...
        ]
    },
    "messageBody": {
        "profile": "alexa-close-talk",
        "locale": "en-us",
        "format": "audio/L16; rate=16000; channels=1"
    }
}

--boundary_term
Content-Disposition: form-data; name="audio"
Content-Type: audio/L16; rate=16000; channels=1

...encoded_audio_data...

--boundary_term--

HTTP Header

For more information about the HTTP Header parameters, see the Speechrecognizer Requests section.

JSON multipart

For more information about the JSON multipart parameters, see the Speechrecognizer Requests section.

Audio multipart

For more information about the Audio multipart parameters, see the Speechrecognizer Requests section.