Detect if mic is in use by another app such as native phone calls

Afternoon all, is it possible to detect if the user is already making a phone call? (natively) or if the mic is in use from another app. I am doing voice recordings but it has issues if the mic is in use elsewhere