UNPKG

@euirim/microsoft-cognitiveservices-speech-sdk

Version:
33 lines (32 loc) 992 B
import { Promise } from "./Promise"; import { Queue } from "./Queue"; export interface IStreamChunk<TBuffer> { isEnd: boolean; buffer: TBuffer; timeReceived: number; } export declare class Stream<TBuffer> { private privId; private privReaderIdCounter; private privStreambuffer; private privIsEnded; private privReaderQueues; constructor(streamId?: string); readonly isClosed: boolean; readonly id: string; getReader: () => StreamReader<TBuffer>; close(): void; writeStreamChunk(streamChunk: IStreamChunk<TBuffer>): void; private throwIfClosed; } export declare class StreamReader<TBuffer> { private privReaderQueue; private privOnClose; private privIsClosed; private privStreamId; constructor(streamId: string, readerQueue: Queue<IStreamChunk<TBuffer>>, onClose: () => void); readonly isClosed: boolean; readonly streamId: string; read: () => Promise<IStreamChunk<TBuffer>>; close: () => void; }