This isn't a question but I thought it might help other amateur coders. I spent hours trying to work this out by reading others' threads and the documentation https://krpano.com/plugins/soundinterface/#actions .
My tour featured audio commentary for each of the 11 scenes and I wanted a global button to turn it on/off rather than for each scene.
I found the soundinterface plugin and added the necessary code near the top of my xml page
<plugin name="soundinterface" url="%SWFPATH%/plugins/soundinterface.swf" alturl="%SWFPATH%/plugins/soundinterface.js" volume="1.0" preload="true"/>
I then started each scene as follows:
<scene name="scene_1" title="1" onstart="" thumburl="panos/1.tiles/thumb.jpg" onstart="stopallsounds();playsound(auto,sounds/1.mp3);" >
First I tried it without stopallsounds(); and they played on top of each other. This simply stops whatever is playing before loading the new audio file.
I then needed a global button and that was the bit I struggled with. Eventually I found this example being used on a thread:
<plugin name="sound-off" url="hotspots/nav-s-off.png" style="button" devices="!iphone+!ipad" x="+200" onhover="showtext(Commentary OFF, buttonstyle);" visible="true" onclick="set(plugin[soundinterface].mute,true);set(plugin[sound-off].visible,false); set(plugin[sound-on].visible,true); "/>
<plugin name="sound-on" url="hotspots/nav-s.png" style="button" devices="!iphone+!ipad" x="+200" onhover="showtext(Commentary ON, buttonstyle);" visible="false" onclick="set(plugin[soundinterface].mute,false);set(plugin[sound-on].visible,false); set(plugin[sound-off].visible,true); "/>
I just thought it might help someone else to see this and wanted to give something to this group for a change