Lip sync

mouth() matches a character's mouth to speech, using the shapes from Rhubarb Lip Sync.

Using mouth shapes in expressions

mouth() uses the master mix at the current time. mouth([1]) uses audio track 1. mouth([0, 2]) uses those tracks.

The result is one of these shapes:

ShapeExampleUse
ARhubarb mouth shape A, with closed lipsClosed mouth for M, B, and P sounds.
BRhubarb mouth shape B, with clenched teethSlightly open mouth with clenched teeth, used for most consonants and sounds such as “ee.”
CRhubarb mouth shape C, moderately openOpen mouth for vowels such as “eh” and “ae.”
DRhubarb mouth shape D, wide openWide-open mouth for vowels such as “aa.”
ERhubarb mouth shape E, slightly roundedSlightly rounded mouth for sounds such as “off” and “bird.”
FRhubarb mouth shape F, with puckered lipsPuckered lips for sounds such as “you,” “show,” and “way.”
GRhubarb mouth shape G, with upper teeth touching the lower lipUpper teeth touching the lower lip for F and V sounds.
HRhubarb mouth shape H, with the tongue behind the upper teethRaised tongue behind the upper teeth for long L sounds.
XRhubarb mouth shape X, with relaxed closed lipsRelaxed idle position used for pauses in speech.

A through F are the basic shapes. G, H, and X are extended shapes that can improve animation when the character artwork supports them.

Use match to map the mouth shape to a property value. The _ case covers the remaining shapes.

match mouth() {
    case "A" { return 0 }
    case "B" { return 1 }
    case _ { return 2 }
}

While a preview is still analyzing, mouth() reports that it is loading. Export waits until analysis finishes.

Mouth-shape illustrations by Daniel Wolf.