Advertisement
Guest User

Untitled

a guest
Dec 25th, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #pragma GCC diagnostic push
  2. #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
  3. -(BOOL)isAudioInputAvailable{
  4. //after iOS 6.0
  5. if ([[AVAudioSession sharedInstance] respondesToSelector:@selector(inputIsAvailable)]) {
  6. BOOL inputAvailable = [[AVAudioSession sharedInstance] inputIsAvailable];
  7. return inputAvailable;
  8. }
  9.  
  10. //before iOS 6.0, This is Deprecated since iOS7
  11. AudioSessionInitialize(NULL, NULL, NULL, NULL);
  12. UInt32 propertySize, inputAvailable;
  13. AudioSessionGetProperty(kAudioSessionProperty_AudioInputAvailable, &propertySize, &inputAvailable);
  14. return (BOOL)inputAvailable;
  15. }
  16. #pragma GCC diagnostic pop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement