Include sound in your animation

https://www.youtube.com/watch?v=OhsfQokqc1c

Sound modulation

const controller = useLottie({
  container: ".lottie",
  path: "/animations/heart/data.json",
  debug: true,
  rateVariation: 0.2, // -20% to 20% speed: pitch will be higher/lower
  volumeVariation: 0.2, // 80% to 100% quieter louder
});

Event

// Event triggered before playing a sound
controller.onAudio((event) => {
	console.log(event) // { audios, audio, data, prevent: false }
});

// stop sounds
controller.onAudio((event) => {
	event.prevent = true;
});