AppTekStreamingClient

Class: AppTekStreamingClient

Constructors

Constructor

new AppTekStreamingClient(proxyUrl, auth): AppTekStreamingClient;

Parameters

ParameterType
proxyUrlstring
authClientAuth

Returns

AppTekStreamingClient

Methods

activateRoom()

activateRoom(ws, roomId): void;

Activates a room mid-session for an existing WebSocket.

Parameters

ParameterType
wsWebSocket
roomIdstring

Returns

void


createRoom()

createRoom(): Promise<RoomResponse>;

Creates a new room.

Returns

Promise<RoomResponse>


createStream()

createStream(config, roomId?): WebSocket;

Creates a WebSocket connection for bidirectional streaming recognition.

Parameters

ParameterType
configRecognize2StreamConfig
roomId?string

Returns

WebSocket


defineDefaults()

defineDefaults(): object;

Returns

object

NameType
audioConfigurationRecognize2AudioConfig
speechConfigurationRecognize2SpeechConfig
translateConfigurationsRecognize2TranslateConfig[]

endStream()

endStream(ws): void;

Gracefully ends the stream by sending a specific JSON Stop signal.
The server will continue to send results until it finishes processing, then it will close the connection.

Parameters

ParameterType
wsWebSocket

Returns

void


getNetworkStats()

getNetworkStats(iterations?, intervalMs?): Promise<NetworkStatsResponse>;

Measure round-trip time (RTT) and network statistics over multiple pings.

Parameters

ParameterTypeDefault valueDescription
iterationsnumber4Number of pings to send (default: 4)
intervalMsnumber200Delay between pings in milliseconds (default: 200)

Returns

Promise<NetworkStatsResponse>


listRooms()

listRooms(): Promise<RoomListResponse>;

List rooms associated with this key.

Returns

Promise<RoomListResponse>


ping()

ping(): Promise<PingResponse>;

Measure network quality and latency by pinging the proxy server.

Returns

Promise<PingResponse>

Object containing round-trip time (RTT), server time offset, and the server response.


recognize2GetAvailable()

recognize2GetAvailable(): Promise<Recognize2AvailableResponse>;

Fetches available recognition models and configurations from the server.

Returns

Promise<Recognize2AvailableResponse>


translateGetAvailable()

translateGetAvailable(): Promise<TranslateAvailableResponse>;

Fetches available translation models and target languages from the server.

Returns

Promise<TranslateAvailableResponse>