Skip to content

Instantly share code, notes, and snippets.

@derrell
Created August 29, 2017 13:18
Show Gist options
  • Save derrell/1ed76577215accc8f547beb176c204a2 to your computer and use it in GitHub Desktop.
Save derrell/1ed76577215accc8f547beb176c204a2 to your computer and use it in GitHub Desktop.
Attempting to stop mic audio from flowing to SIP server
onlocalstream : function(stream)
{
console.log("SIP: attaching local stream");
// Initially mute the microphone
var tracks = stream.getAudioTracks();
tracks.forEach(
function(track)
{
console.warn("SIP: before enabled=false: track=", track);
track.enabled = false;
console.warn("SIP: after enabled=false: track=", track);
});
setTimeout(
function()
{
console.warn("SIP: stopping audio track");
tracks[0].stop();
}, 5000);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment