echogarden
Version:
An easy-to-use speech toolset. Includes tools for synthesis, recognition, alignment, speech translation, language detection, source separation and more.
25 lines (24 loc) • 1.37 kB
TypeScript
import { ParagraphBreakType, WhitespaceProcessing } from '../api/Common.js';
export declare function addTimeOffsetToTimeline(targetTimeline: Timeline, timeOffset: number): Timeline;
export declare function multiplyTimelineByFactor(targetTimeline: Timeline, factor: number): Timeline;
export declare function roundTimelineProperties(targetTimeline: Timeline, decimalDigits?: number): Timeline;
export declare function wordTimelineToSegmentSentenceTimeline(wordTimelineWithOffsets: Timeline, transcript: string, language: string, paragraphBreaks?: ParagraphBreakType, whitespace?: WhitespaceProcessing): Promise<{
segmentTimeline: Timeline;
}>;
export declare function addWordTextOffsetsToTimelineInPlace(timeline: Timeline, text: string): void;
export declare function extractEntries(timeline: Timeline, predicate: (entry: TimelineEntry) => boolean): TimelineEntry[];
export type TimelineEntryType = 'segment' | 'paragraph' | 'sentence' | 'clause' | 'phrase' | 'word' | 'token' | 'letter' | 'phone' | 'subphone';
export type TimelineEntry = {
type: TimelineEntryType;
text: string;
startTime: number;
endTime: number;
startOffsetUtf16?: number;
endOffsetUtf16?: number;
startOffsetUtf32?: number;
endOffsetUtf32?: number;
confidence?: number;
id?: number;
timeline?: Timeline;
};
export type Timeline = TimelineEntry[];