2 Replies
      Latest reply on Jan 4, 2020 7:43 PM by dumbbunny
      dumbbunny Level 1 Level 1 (0 points)

        Hi,

         

        MacOS 10.15.2

         

        <key>NSMicrophoneUsageDescription</key>

          <string>Record audio!</string>

         

        This crashes.

        [AVCaptureDevice requestAccessForMediaType:AVMediaTypeAudio completionHandler:^(BOOL granted)

                 {

                    if (granted)

                    {

                        // [self setupCaptureSession];

                    }

                }];

         

        Also,

        Preferences->Security & Privacy - Microphone has no reference to the Voice Memo app even after using it and allowing access to the mic.

         

        Any help appreciated.

        Paul

        • Re: AVCaptureDevice requestAccessForMediaType
          dumbbunny Level 1 Level 1 (0 points)

          Hi,

          MacOS 10.15.2

           

          <key>NSMicrophoneUsageDescription</key>

            <string>Record audio!</string>

           

          This works in a swift project:

           

          AVCaptureDevice.requestAccess(for: .audio) { granted in

                      if granted {

                          //self.setupCaptureSession()

                      }

                  }

           

          This doesn't work in an ObjectiveC project: (Thread 6: signal SIGABRT)

          [AVCaptureDevice requestAccessForMediaType:AVMediaTypeAudio completionHandler:^(BOOL granted)

                   {

                      if (granted)

                      {

                          // [self setupCaptureSession];

                      }

                  }];

           

          What am I not doing correcty or forgot to include?

           

          Thanks, paul