WitWebSocketSpeechRequest Class
Performs a request that transmits raw audio samples to a web service, downloads and encodes responses.
bool IsReadyForInput[Get]
Callback when the server is ready to upload audio
Callback action when ready for input is toggled on
WitWebSocketSpeechRequest ( string endpoint,
Dictionary< string, string > parameters,
string requestId )
Constructor for request that posts binary audio data
ParametersendpointThe endpoint to be used for the request
parametersAll additional data required for the request
requestIdA unique id to be used for the request
virtual override void HandleDownload ( string jsonString,
byte [] binaryData )
Called multiple times as partial responses are received. Determines if ready for input and if so, performs the appropriate callback following the application of data.
ParametersjsonStringRaw json string.
jsonDataDecoded json data object.
binaryDataDecoded binary data chunk which should be null or empty.
void SendAudioData ( byte [] buffer,
int offset,
int length )
Public method for sending binary audio data
ParametersbufferThe buffer used for uploading data
offsetThe starting offset of the buffer selection
lengthThe length of the buffer to be used
virtual void CloseAudioStream ( )