You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
516B

  1. #include <rtaudio.hpp>
  2. #import <AVFoundation/AVFoundation.h>
  3. namespace rack {
  4. bool rtaudioIsMicrophoneBlocked() {
  5. // authorizationStatusForMediaType is only available on Mac 10.14+.
  6. if (@available(macOS 10.14, *)) {
  7. AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio];
  8. return status == AVAuthorizationStatusRestricted || status == AVAuthorizationStatusDenied;
  9. }
  10. // On earlier versions, assume microphone is not blocked.
  11. return false;
  12. }
  13. } // namespace rack