UNPKG

@voice-ping/cognitive-services-speech

Version:

VoicePing Cognitive Services Speech SDK for JavaScript forked from Microsoft

43 lines (42 loc) 2.23 kB
import { ConnectionMessage, IAudioSource, IConnection, Promise } from "../../common/Exports"; import { CancellationErrorCode, CancellationReason } from "../../sdk/Exports"; import { IAuthentication, IConnectionFactory, RecognizerConfig, ServiceRecognizerBase } from "../Exports"; import { ConversationTranslatorRecognizer } from "./ConversationTranslatorRecognizer"; /*** * The service adapter handles sending and receiving messages to the Conversation Translator websocket. */ export declare class ConversationServiceAdapter extends ServiceRecognizerBase { private privConversationServiceConnector; private privConversationConnectionFactory; private privConversationAuthFetchEventId; private privConversationAuthentication; private privConversationRequestSession; private privConnectionConfigPromise; private privConversationConnectionPromise; private privConnectionLoop; private terminateMessageLoop; private privLastPartialUtteranceId; private privConversationIsDisposed; constructor(authentication: IAuthentication, connectionFactory: IConnectionFactory, audioSource: IAudioSource, recognizerConfig: RecognizerConfig, conversationServiceConnector: ConversationTranslatorRecognizer); isDisposed(): boolean; dispose(reason?: string): void; sendMessage(message: string): void; sendMessageAsync: (message: string) => Promise<boolean>; protected privDisconnect(): void; protected processTypeSpecificMessages(connectionMessage: ConnectionMessage, successCallback?: (e: any) => void, errorCallBack?: (e: string) => void): boolean; protected cancelRecognition(sessionId: string, requestId: string, cancellationReason: CancellationReason, errorCode: CancellationErrorCode, error: string): void; protected noOp: () => any; /** * Establishes a websocket connection to the end point. * @param isUnAuthorized */ protected conversationConnectImpl(isUnAuthorized?: boolean): Promise<IConnection>; /** * Process incoming websocket messages */ private receiveConversationMessageOverride; private startMessageLoop; private configConnection; private getTranslations; private fetchConversationConnection; }