I'm making an app for a specialist purpose that requires 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.
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.
I can see at least one app where this functionality is present. Lesser AudioSwitch will display whether my input is from the Headset or Internal Microphone when I connect/disconnect my headset.
How would I achieve this in my own app?