avatoon
Version:
A React Three Fiber component for realistic avatar lip-syncing and animations.
37 lines (35 loc) • 1.37 kB
TypeScript
import { VisemeData } from '../types';
/**
* Helpers that convert viseme/mouth-shape timing from common speech engines
* into Avatoon's `visemeJson` format. Each returns `{ visemes: [...] }` with
* `time` in **seconds** and a `viseme` code understood by `phonemeToViseme`.
*/
export interface AzureVisemeEvent {
/** Azure viseme id (0–21). */
visemeId: number;
/** Audio offset in 100-nanosecond ticks (as provided by the Speech SDK). */
audioOffset: number;
}
/** Convert Azure Speech SDK viseme events into `visemeJson`. */
export declare function fromAzureVisemes(events: AzureVisemeEvent[]): VisemeData;
export interface PollySpeechMark {
type?: string;
/** Time offset in milliseconds. */
time: number;
/** Polly viseme value. */
value: string;
}
/** Convert AWS Polly speech marks into `visemeJson` (non-viseme marks ignored). */
export declare function fromPollySpeechMarks(marks: PollySpeechMark[]): VisemeData;
export interface RhubarbMouthCue {
/** Start time in seconds. */
start: number;
end: number;
/** Rhubarb mouth shape (A–H, X). */
value: string;
}
export interface RhubarbOutput {
mouthCues: RhubarbMouthCue[];
}
/** Convert Rhubarb Lip Sync output (or its `mouthCues`) into `visemeJson`. */
export declare function fromRhubarb(input: RhubarbOutput | RhubarbMouthCue[]): VisemeData;