我想使用 curl的 Alexa 语音 API ( https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/rest/speechrecognizer-requests )。voicerecogniser API 调用比我习惯使用的更复杂,并且需要一个包含语音样本的 MP3 文件附件。谁能建议如何使用 curl 构建以下内容?(在给定的链接上有更多信息)
POST /v1/avs/speechrecognizer/xxxxxxxxxxxx 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--