Is there a way to stop audio via code?

I have a nice little project that’s ready for me to share in my portfolio, except for one thing that’s bothering me. I would love for the music to stop when the “tapir full” button is pressed. Is there a simple way to control this via code that can be used on a web page? I’ve asked around several places. People seem to think it’s doable but no one has published any examples that I can find.

In order to loop the music I have it playing on its own layer, triggered by a boolean input (“tapir-on”). Is there a way to tie the “false” state of an input to stopping an audio file?

(I have literally just started learning html and javascript this week, but I’m a loooong way from being able to figure out the solution myself. I would be grateful for any advice on how put this final bit of polish on the project.)

https://rive.app/s/FgyFn8dlxEOg86pHME05aA/?runtime=rive-renderer