@diffusionstudio/core-v4
Version:
A fast, browser based video compositing engine powered by WebCodecs
56 lines (55 loc) • 1.44 kB
TypeScript
import { BaseSource } from '../source';
import { Transcript } from '../../types';
export type GeneratorOptions = {
/**
* Iterates by word count
*/
count: number;
} | {
/**
* Iterates by group duration
*/
duration: number;
} | {
/**
* Iterates by number of characters within the group
*/
length: number;
};
export type WordGroup = Transcript[number]['words'];
declare const CaptionSource_base: {
new (...args: any[]): {
height: import('../..').int;
width: import('../..').int;
get aspectRatio(): number;
id: string;
mimeType: string;
input: import('../..').MediaInput;
name: string;
createdAt: string;
init(): Promise<void>;
arrayBuffer(): Promise<ArrayBuffer>;
toJSON(): string;
fromJSON<K = {}>(obj: K extends string ? never : K): /*elided*/ any;
};
} & typeof BaseSource;
export declare class CaptionSource extends CaptionSource_base {
transcript: Transcript;
get duration(): number;
init(): Promise<void>;
computeWpm(): number;
groupBy(options: GeneratorOptions): WordGroup[];
/**
* Convert the transcript into a SRT compatible
* string and downloadable blob
*/
toSrt(): {
text: string;
blob: Blob;
};
/**
* This method will optimize the transcipt for display
*/
optimize(): this;
}
export {};