@livekit/components-core
Version:
This package is a wrapper around the [livekit/client-sdk-js](https://github.com/livekit/client-sdk-js) package. It transforms the event based logic into simple to use observable state and component level APIs. This package is the core for all framework sp
19 lines • 1.08 kB
TypeScript
import type { TranscriptionSegment } from 'livekit-client';
export type ReceivedTranscriptionSegment = TranscriptionSegment & {
receivedAtMediaTimestamp: number;
receivedAt: number;
};
export declare function getActiveTranscriptionSegments(segments: ReceivedTranscriptionSegment[], syncTimes: {
timestamp: number;
rtpTimestamp?: number;
}, maxAge?: number): ReceivedTranscriptionSegment[];
export declare function addMediaTimestampToTranscription(segment: TranscriptionSegment, timestamps: {
timestamp: number;
rtpTimestamp?: number;
}): ReceivedTranscriptionSegment;
/**
* @returns An array of unique (by id) `TranscriptionSegment`s. Latest wins. If the resulting array would be longer than `windowSize`, the array will be reduced to `windowSize` length
*/
export declare function dedupeSegments<T extends TranscriptionSegment>(prevSegments: T[], newSegments: T[], windowSize: number): T[];
export declare function didActiveSegmentsChange<T extends TranscriptionSegment>(prevActive: T[], newActive: T[]): boolean;
//# sourceMappingURL=transcriptions.d.ts.map