How can i get Microphone Insert or pull state and Monitor this state

How do we know if a voice input device is available, such as if the microphone has been plugged in or pulled out, and can be listened for during a game

wait a answer, thanks!