import type {JapaneseMouthShape, MouthTimeline} from "./types";

export const getMouthAtTime = (
  timeline: MouthTimeline | undefined,
  seconds: number
): JapaneseMouthShape =>
  timeline?.cues.find((cue) => seconds >= cue.start && seconds < cue.end)
    ?.mouth ?? "rest";
