I am recording audio from microphone in a browser using MediaStream Recording API. I would like to provide user with a visual feedback of a pulsating microphone icon. Something like this, only tied to the actual sound amplitude from the mike. https://codepen.io/megwayne/pen/bWOYEj How do I do this?
I am recording audio like this:
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
const mediaRecorder = new MediaRecorder(stream);
const audioChunks = [];
mediaRecorder.addEventListener("dataavailable", event => {
audioChunks.push(event.data);
});