I'm using Peer.js for sharing streams across users, I want to listen for the audio events like mic on, off. And also is there a way to check whether the user is speaking or he is silent.
This is how I'm muting when user click on mute button,
const audioTrack = stream.getAudioTracks()[0];
audioTrack.enabled = false;
I want to listen for this event in all other users to show that he is muted his mic.