public class SpeechSendAudio extends SpeechSendEvent
SpeechSendEvent
that sends a RequestBody to the AVS servers, this request body can either be a byte[]
straight write, or a threaded write loop based on incoming data (recorded audio).mCallback, mOutputStream
Constructor and Description |
---|
SpeechSendAudio() |
Modifier and Type | Method and Description |
---|---|
protected okhttp3.RequestBody |
getRequestBody() |
void |
onError(AsyncCallback<AvsResponse,java.lang.Exception> callback,
java.lang.Exception e) |
void |
sendAudio(java.lang.String url,
java.lang.String accessToken,
DataRequestBody requestBody,
AsyncCallback<AvsResponse,java.lang.Exception> callback)
Post an audio byte[] to the Alexa Speech Recognizer API
|
addFormDataParts, getEvent
completeGet, completePost, prepareConnection
public void sendAudio(java.lang.String url, java.lang.String accessToken, @NotNull DataRequestBody requestBody, AsyncCallback<AvsResponse,java.lang.Exception> callback) throws java.io.IOException
url
- the URL to which we're sending the AVS postaccessToken
- our user's access token for the serverrequestBody
- our OkHttp RequestBody for our mulitpart send, this request body can either be a byte[]
straight write, or a threaded write loop based on incoming data (recorded audio).callback
- our event callbacksjava.io.IOException
public void onError(AsyncCallback<AvsResponse,java.lang.Exception> callback, java.lang.Exception e)
@NotNull protected okhttp3.RequestBody getRequestBody()
getRequestBody
in class SpeechSendEvent