I can't find any way of checking if the user has given the app permission to use the microphone. I'm recording like this:
audio.clip = Microphone.Start("Built-in Microphone", true, LOOPLENGTH, AudioSettings.outputSampleRate);
audio.loop = true;
while (!(Microphone.GetPosition("Built-in Microphone") > 0)) {
} audio.Play();
which works fine. but if the user has not granted permission then there doesn't seem to be any way of checking, in order to behave differently (or show an alert, etc)
I've tried checking if Microphone.Start returns null, but when permission is turned off it still returns non-null.
I've also tried checking Microphone.IsRecording, but that seems to return true even when permission is turned off as well.
↧