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

WitSocketRequest Class

A WitSocketRequest implementation using web sockets

Properties

The configuration to be used for the request
The script used to transmit data
The audio buffer used for audio based requests
Endpoint to be used
Whether request is used for transcribing only
Audio encoding used for audio requests
Whether or not the audio stream is ready
Callback when socket connection is ready to send data
Web socket request being performed

Protected Fields

Web socket client decodes responses prior to raw response callback for request id lookup.

Static Member Functions

Return web socket message request initialized with required data
Parameters
configuration
Configuration to be used when authenticating web socket client.
webSocketAdapter
Adapter used to communicate with web socket client.
options
Optional parameter for web request options.
events
Optional parameter for request event callbacks.
Returns
Return web socket speech request initialized with required data to generate an audio request.
Parameters
configuration
Configuration to be used when authenticating web socket client.
webSocketAdapter
Adapter used to communicate with web socket client.
audioBuffer
Audio input buffer used to obtain audio data
options
Optional parameter for web request options.
events
Optional parameter for request event callbacks.
Returns
Return web socket request initialized on an external client but handled locally.
Parameters
webSocketRequest
The externally generated web socket request.
configuration
Configuration to be used when authenticating web socket client.
webSocketAdapter
Adapter used to communicate with web socket client.
audioBuffer
Audio input buffer used to obtain audio data
options
Optional parameter for web request options.
events
Optional parameter for request event callbacks.
Return web socket transcribe request initialized with required data to generate a short audio request.
Parameters
configuration
Configuration to be used when authenticating web socket client.
webSocketAdapter
Adapter used to communicate with web socket client.
audioBuffer
Audio input buffer used to obtain audio data
options
Optional parameter for web request options.
events
Optional parameter for request event callbacks.
Return web socket dictation request initialized with required data to generate a long form audio request.
Parameters
configuration
Configuration to be used when authenticating web socket client.
webSocketAdapter
Adapter used to communicate with web socket client.
audioBuffer
Audio input buffer used to obtain audio data
options
Optional parameter for web request options.
events
Optional parameter for request event callbacks.

Protected Functions

Ignore state changes unless setup
Get send error options
Begins uploading data
Parameters
onSendComplete
Callback that handles send completion
Handle cancellation
Error returned if audio cannot be activated
Activates audio and calls activated callback once complete
Deactivates audio asap and calls deactivated callback once complete

Member Functions

Public method for sending binary audio data
Parameters
buffer
The buffer used for uploading data
offset
The starting offset of the buffer selection
length
The length of the buffer to be used
Did you find this page helpful?
Thumbs up icon
Thumbs down icon