title: How to mute/unmute mic in webrtc
body: <p>I have read from here that how i can mute/unmute mic for a localstream in webrtc:<a href="http://muaz-khan.blogspot.no/2014/05/webrtc-tips-tricks.html" rel="noreferrer">WebRTC Tips &amp; Tricks
  </a></p>
  
  <p>When i start my localstream mic is enable at that time by default so when i set  audioTracks[0].enabled=false it muted a mic in my local stream but when i set it back true it enable to unmute. Here is my code mute/unmute for a localstream: </p>
  
  <pre><code> getLocalStream(function (stream,enable) {
          if (stream) {
              for (var i = 0; i &lt; stream.getTracks().length; i++) {
                  var track = stream.getAudioTracks()[0];
                  if (track)
                      track.enabled = enable;
                  //track.stop();
              }
          }
      });
  </code></pre>
  
  <p>Can someone suggest me how i can unmute mic back in a localstream.</p>