About audio input device

How do we know if a voice input device is available, such as if the microphone has been plugged in or pulled out,
i can also listen for microphone unplug or insert events while the game is going on