Subject: How to stop audio when switching animation states?

Hi eveybody,

I have three animations—A, B, and C—each with its own audio triggered by an Audio Event. I use a State Machine to switch between them.

When I switch from animation A to B, audio A keeps playing and overlaps with audio B. I’d like the previous audio to stop immediately whenever the state changes.

Is there a built-in way to achieve this in the editor, or should I use Scripting to manage audio playback? If Scripting is the recommended approach, could you share an example of connecting state changes to audio stop/play controls?

Ideally, I’d like to handle this entirely within Rive, without external application code.

Thanks for your help!