API reference
API reference
Select your platform
No SDKs available
No versions available

WitWebSocketSpeechRequest Class

Performs a request that transmits raw audio samples to a web service, downloads and encodes responses.

Constructors

WitWebSocketSpeechRequest ( endpoint , parameters , requestId , clientUserId , endWithFullTranscription )
Constructor for request that posts binary audio data
Signature
Meta.Voice.Net.WebSockets.Requests.WitWebSocketSpeechRequest.WitWebSocketSpeechRequest(string endpoint, Dictionary< string, string > parameters, string requestId=null, string clientUserId=null, bool endWithFullTranscription=false)
Parameters
endpoint: string  The endpoint to be used for the request
parameters: Dictionary< string, string >  All additional data required for the request
requestId: string  A unique id to be used for the request
clientUserId: string
endWithFullTranscription: bool

Properties

IsReadyForInput : bool
[Get]
Callback when the server is ready to upload audio
Signature
bool Meta.Voice.Net.WebSockets.Requests.WitWebSocketSpeechRequest.IsReadyForInput

Events

OnReadyForInput : Action
Callback action when ready for input is toggled on
Signature
Action Meta.Voice.Net.WebSockets.Requests.WitWebSocketSpeechRequest.OnReadyForInput

Methods

CloseAudioStream ()
Stop sending audio data
Signature
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketSpeechRequest.CloseAudioStream()
Returns
void
HandleDownload ( jsonString , jsonData , 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.
Signature
override void Meta.Voice.Net.WebSockets.Requests.WitWebSocketSpeechRequest.HandleDownload(string jsonString, WitResponseNode jsonData, byte[] binaryData)
Parameters
jsonString: string  Raw json string.
jsonData: WitResponseNode  Decoded json data object.
binaryData: byte []  Decoded binary data chunk which should be null or empty.
Returns
override void
SendAudioData ( buffer , offset , length )
Public method for sending binary audio data
Signature
void Meta.Voice.Net.WebSockets.Requests.WitWebSocketSpeechRequest.SendAudioData(byte[] buffer, int offset, int length)
Parameters
buffer: byte []  The buffer used for uploading data
offset: int  The starting offset of the buffer selection
length: int  The length of the buffer to be used
Returns
void