In my iOS
application, I want to show an Alert
, if Mic is not available in the device
.
How can I check this ?
I have tried this-
-(void)checkMic
{
UInt32 sessionCategory = kAudioSessionCategory_RecordAudio;
OSStatus status = AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, sizeof (sessionCategory), &sessionCategory); //..always seems to return OK..
status = AudioSessionSetActive (true);
if(status)
{
//mic is not available
}
}
But this code is showing an error with message - deprecated.