SpeechSendAudio
instead, either with a byte[] or using the streamed RequestBody@Deprecated public class SpeechSendVoice extends SpeechSendEvent
SpeechSendEvent
that sends a recorded raw audio to the AVS server, unlike SpeechSendText
, this does not use an intermediary steps, but the starting/stopping
need to be handled manually or programmatically, which Google's voice offering already does automatically (listens for speech thresholds).
This is the class that should be used, ideally, instead of SpeechSendText, but it offers a little less flexibility as a standalone.
Using the byte[] buffer in startRecording(), it's possible to prepend any audio recorded with pre-recorded or generated audio, in order to simplify or complicate the command.mCallback, mOutputStream
Constructor and Description |
---|
SpeechSendVoice()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected okhttp3.RequestBody |
getRequestBody()
Deprecated.
|
void |
startRecording(java.lang.String url,
java.lang.String accessToken,
byte[] buffer,
AsyncCallback<java.lang.Void,java.lang.Exception> callback)
Deprecated.
Manage this state on the application side, instead, and send the audio using
SpeechSendAudio |
AvsResponse |
stopRecording()
Deprecated.
Manage this state on the application side, instead, and send the audio using
SpeechSendAudio |
addFormDataParts, getEvent
completeGet, completePost, prepareConnection
@Deprecated public void startRecording(java.lang.String url, java.lang.String accessToken, @Nullable byte[] buffer, @Nullable AsyncCallback<java.lang.Void,java.lang.Exception> callback) throws java.io.IOException
SpeechSendAudio
url
- our POST urlaccessToken
- our user's access tokenbuffer
- a byte[] that allows us to prepend whatever audio is recorded by the user with either generated ore pre-recorded audio, this needs
to be in the same format as the audio being recordedcallback
- our callback to notify us when we change statesjava.io.IOException
@Deprecated public AvsResponse stopRecording() throws java.io.IOException, AvsException
SpeechSendAudio
java.io.IOException
AvsException
@NotNull protected okhttp3.RequestBody getRequestBody()
getRequestBody
in class SpeechSendEvent