1

I am using sound manager 2 for giving sound to my site.. Now i want mute and unmute sound on

clicking a button. I tried mute() and unmute() functions. But didnt get the result.

My code for mute is :

function mutesound(){
            soundManager.mute(); // mute all sounds

            soundManager.createSound({
             id: 'msound',
             url: 'folder/sound/click.mp3',
             autoLoad:true,
             onload: function() {
               soundManager.mute('msound'); 

              } 
            });
        }

Can someone help me please?

Micku
  • 550
  • 4
  • 9
  • 23

2 Answers2

0

mute() and unmute() are methods, you should apply these to the SoundManager object. Which is by default called soundManager.

soundManager.toggleMute()
Community
  • 1
  • 1
Andy Hayden
  • 359,921
  • 101
  • 625
  • 535
0

You can put it in a variable so you can call it afterwards I think. Something like

var player = soundManager.createSound({ 
  ...
});

player.mute();

player.unmute();

Tell me what happens.

index
  • 3,697
  • 7
  • 36
  • 55