Play sound when the mic is opened or closed

I have used the mit app inventor a few times and created a few apps. I am bit stuck on how to create one I thought of. I want to run in the background and play a sound if the mic is opened or closed. Can anyone assist me?

how do you open or close the mic?
Taifun

I wouldn't open or close the mic, only detect if some app has done so.

App Inventor itself can't do it and I do not know, if we already have an extension, which is able to do this?

Here is a snippet to detect, if the microphone is available

If there is no extension already available to detect this, you could write your own extension to do so...

more information about how to create an extension see the App Inventor Extensions document
however that will be more advanced and will require some Java skills...

And then execute that check in the background... To do that, you have to get familiar with itoo first

Taifun