title: How do I check if Headset or Internal Microphone is being used for microphone input?
body: <p>I'm making an app for a specialist purpose that <em>requires</em> a headset microphone to be connected. I don't want users to mistakenly use their phone's built-in microphone and have a substandard experience, so ideally the app should enforce a 3.5mm headset to be used.</p>
  <p>Unfortunately, I haven't been able to find anything about this online, only posts about checking if a microphone is available. I want to instead check for the presence of a headset plugged into the 3.5mm jack.</p>
  <p>I can see at least one app where this functionality is present. <a href="https://play.google.com/store/apps/details?id=com.nordskog.LesserAudioSwitch" rel="nofollow noreferrer">Lesser AudioSwitch</a> will display whether my input is from the Headset or Internal Microphone when I connect/disconnect my headset.</p>
  <p>How would I achieve this in my own app?</p>