Ways to mute the microphone

How can I mute my microphone when using react-native-webrtc, I tried this:

const tracks = idx(pc._localStreams, _ => _[0]._tracks) || []
const track = tracks.find(elem => elem.kind === 'audio')
if (!track) {
  return
}
track.muted = !localMic

Hi, try this

const stream = await mediaDevices.getUserMedia({
audio: true,
video: false
})
.catch(error => {
console.log('error: ', error)
});
stream.getTracks()[0].enabled = !muted;`

localStream.getTracks().forEach((t) => {
    if (t.kind === 'audio') t.enabled = !t.enabled;
});

:slight_smile: