Hi Charlie
The only way to interact (and manipulate) an audio file is if it is created either by dragging the audio onto the scene or including it within the inner HTML of an element as an audio tag.
You can create the same effect as the action “play sound” by including this piece of javascript in a new function “on scene load”.
window.audioElement = document.createElement('audio');
audioElement.setAttribute('src', '${resourcesFolderName}/drum1.mp3'); /// This can be any sound in your resources area
audioElement.play();
audioElement.loop = "true";
You can then access the global variable audioElement
to manipulate the audio.
You can then use an “On Mouse Click” action on your menu button and run another javascript function and place the following in it to toggle the muted state.
if (audioElement.muted) {
audioElement.muted = "";
} else {
audioElement.muted = "true";
}