You shouldn't need to simulate mouse input to do this. You can make clicking an object call a function, and then call the function instead of simulating input, to do the same thing as if the object was clicked.
Hi, thanks for your reply. Eventually I managed to do it like this:
document.addEventListener("dblclick", () =>
{
Main.PlaySound();
});