Is there a way to detect when the microphone of my Mac is in use? Similar to what Mikro Snitch does? Can this be done in Cocoa?
This isn't really an Objective-C or Cocoa solution, but if you're willing to do a subprocess call, try this:
ioreg -c AppleHDAEngineInput | grep IOAudioEngineState
You will see "IOAudioEngineState" = 1
when audio input is active.
Also, try searching for IOAudioEngineNumActiveUserClients
which increases by one for each app taking in audio.