avatoon
Version:
A React Three Fiber component for realistic avatar lip-syncing and animations.
22 lines (20 loc) • 868 B
TypeScript
import { VisemeData } from '../types';
export interface ParsedViseme {
time: number;
viseme: string | null;
}
/**
* Maps the raw `visemeJson` entries to morph-target names using the provided
* code→morph map, dropping any codes that don't resolve to a morph.
*/
export declare function parseVisemes(visemeJson: VisemeData, map: Record<string, string>): ParsedViseme[];
/**
* Returns the most recent viseme at or before `currentTime` (the timeline is
* scanned newest-first), or `null` if none applies yet.
*/
export declare function findActiveViseme(visemeData: ParsedViseme[], currentTime: number): ParsedViseme | null;
/**
* Triangular blink influence (0 → 1 → 0) for a given time `into` the blink,
* over `duration` seconds. Returns 0 outside the blink window.
*/
export declare function blinkPulse(into: number, duration?: number): number;