I developed one web-based monitoring system Using js and WebRTC and now I want to develop notification function if the sound goes beyond some level.
I'm taking permission for video and audio and after permission, I want to use the function for sound notification.
navigator.mediaDevices
.getUserMedia({
audio: true,
video: true
})
.then(stream => {
// Display your local video in #localVideo element
localVideo.srcObject = stream;
// Add your stream to be sent to the conneting peer
pc.addStream(stream);
// call function for sound check
}, onError);