You can call soundManager.stopAll()
or soundManager.pauseAll()
(documentation) before you start your desired sound. Believe the below code should work kind of just picked and chose from some code I've written before:
soundManager.setup({
preferFlash: false,
//, url: "swf/"
onready: function () {
soundManager.createSound({
url: [
"http://www.html5rocks.com/en/tutorials/audio/quick/test.mp3", "http://www.html5rocks.com/en/tutorials/audio/quick/test.ogg"
],
id: "music"
});
soundManager.createSound({
url: [
"http://www.w3schools.com/html/horse.mp3", "http://www.w3schools.com/html/horse.ogg"
],
id: "horse"
});
soundManager.play("music"); //start playing annoying music
}
}).beginDelayedInit();
And to start horse and pause all other sounds currently playing in a click event:
$("#horse").click(function () {
soundManager.stopAll();
soundManager.play("horse");
});