Lip-sync in Rive
First, it's worth mentioning that Rive doesn't have auto-lip-sync. Not yet. If you want to do an auto-lip-sync, part of the process depends on an external process that I haven't been able to test yet, so I'll focus only on what concerns Rive. On the other hand, if you want to do a lip-sync in a timeline, you'll see the complete process here.
Lip sync 01.mp4Mouth
The most important thing is to have the different mouths we need for the lip-sync. There are many ways to do this. You can create them in Rive or import them. It will depend on the design and the type of animation. But if you want the mouth to move fluidly, I recommend creating a mouth rig that allows you to create different visemes. Here's a simple example of a four-control rig. Each control changes a part of the mouth in position, rotation, and scale. Each control uses a bone that is weighted to the different mouth shapes.
Lip sync 02.mp4Visemes
Once you finish with the mouth rig, it's time to create the different visemes. To do this, use the mouth controls to create an animation for each viseme. If you're not sure how to make visemes, you can find many references online. My recommendation is to create just the necessary ones.
Lip sync 03.mp4Once we have the visemes, it's time to work with the state machine. The idea is to create a system that allows us to change visemes using one or more values, depending on the lip sync we want to make. If you want a simple lip-sync in which one mouth changes to another, the best option is to use Any State. But if you want multiple mouths to blend, the best option is to use a blend state.
Any State
In this case, all you have to do is drag all the visemes into the state machine and connect them to Any State, adding a duration and interpolation for each transition. To control the mouth, use a numeric input and add the corresponding value as a condition to each transition. Now, each value corresponds to one viseme.
Lip sync 04.mp4Blend State
For this option, use the Blend State Additive, which allows you to mix multiple animations using multiple numeric inputs. To do this, you need to create a numeric input for each viseme and add and connect each viseme animation to the numeric input in the Blend state. Make sure to use the "Mix by input" option. Start with the mouth's neutral position and ensure it's at the end of the list. Add the value 100 to the mouth's neutral position to work correctly. This way, all the mouths will blend with the neutral position. This allows you to activate a specific mouth or combine several to create another.
Once the state machine is complete, if you want to create auto-lip-syncing, you need to break down the speech from text into syllables, phonemes, and visemes and use them to trigger the correct viseme based on the phoneme in the state machine. Something like this, but as I mentioned at the beginning, it’s something I've been able to test yet.
Lip-sync on the timeline
This lip sync is more of an old-school animation in which you animate the mouth following the audio. You can use the state machine by creating a key of the inputs in the timeline, but I recommend, for this case, using a joystick to control the mouth because it's much easier to control. To do this, instead of creating a state machine and animations for each viseme, you need to make an animation for the horizontal movement of the mouth and another for the vertical and add them to the joystick.
Lip sync 06.mp4Once the joystick is ready, with the audio in the timeline, you can create a key for each mouth position following the audio. This process isn't perfect. We need to add more options, but it allows you to create a very expressive lip sync by combining the mouth animation with the character's rig.
Lip sync 07.mp4Some tips:
There's no perfect rig. Create a rig that lets you do what you need.
Don't try to do everything the first time. Do several tests to understand the process and see what works best for you.
For timeline lip sync, split the audio into different parts so you don't always have to play it from the beginning.