1 Reply
      Latest reply on Oct 7, 2019 2:54 AM by chnbr
      chnbr Level 1 Level 1 (0 points)

        Hi,

         

        I am trying to port audio input to Mac Catalyst. As of now I am using xcode11.1GMseed, macOS 10.15 Beta 10 and (ios13 release).

         

        The following code does not return any input ports under catalyst, it works however on iOS deivces. I have granted the "Hardend Runtime - Audio Input" entitlement and also the catalyst app asks for microphone permission which is granted then of course. So it is not a permission problem.

         

        let audioSession = AVAudioSession.sharedInstance()
        try audioSession.setActive(true, options: .notifyOthersOnDeactivation)
        
        var mic : AVAudioSessionPortDescription? = nil
        for input in audioSession.availableInputs! {
          if input.portType == AVAudioSession.Port.builtInMic {
            mic = input
          } else {
            print("Not internal mic")
        }
        
        
        // ERROR !!! here: 'mic' is nil, but it should at least find builtInMic

         

        When accessing audioSession.availableInputs the following error show up in the console:

         

        2019-10-02 08:20:18.005998+0200 [3340:162455] [avas] AVAudioSession_MacOS.mm:258:-[AVAudioSession getChannelsFromAU:PortName:PortID:]: ERROR in getting channel layout for auScope 1768845428 element 1

        2019-10-02 08:20:18.006890+0200 [3340:162455] [avas] AVAudioSession_MacOS.mm:351:-[AVAudioSession createPortsfromAggregateDevice:]: No Ports available returning empty

         

         

        Is this a bug due to beta status of the whole stuff or am I missing something ? We are now in 10.15. beta 10 which is probably near release ...

         

        Thanks

        Chris