How to suppress warnings generated by accessing `AVAudioEngine`'s `inputNode` on macOS
Asked Answered
R

0

16

I have the following test code for getting realtime microphone input on macOS:

import AVFoundation // for AVAudioEngine

class Mic
{
    public let audioEngine = AVAudioEngine()

    func startRecording() throws
    {
        print("- - -")
        let inputNode = audioEngine.inputNode
        print("- - -")

        if inputNode.inputFormat(forBus: 0).sampleRate == 0 {
            exit(0);
        }

        let recordingFormat = inputNode.outputFormat(forBus: 0)
        inputNode.installTap(onBus: 0, bufferSize: 1024, format: recordingFormat) { (buffer: AVAudioPCMBuffer, when: AVAudioTime) in
            print( "YES! Got some samples!")
        }

        audioEngine.prepare()

        try audioEngine.start()
    }

    func stopRecording()
    {
        audioEngine.stop()
    }
}

I get output:


2019-07-22 16:26:36.773244+0300 realtime_mic[8111:540360] [plugin] AddInstanceForFactory: No factory registered for id F8BB1C28-BAE8-11D6-9C31-00039315CD46
2019-07-22 16:26:36.803372+0300 realtime_mic[8111:540360] HALC_ShellDriverPlugIn::Open: Can't get a pointer to the Open routine
2019-07-22 16:26:36.804020+0300 realtime_mic[8111:540360] HALC_ShellDriverPlugIn::Open: Can't get a pointer to the Open routine


Does this mean I'm doing something wrong?

Is it possible to prevent these warnings from displaying on the console?

Redouble answered 22/7, 2019 at 13:32 Comment(5)
I see these warnings only in the Xcode 11 betas, it's hidden in die Xcode 10 final. Hopefully they will also go away once Xcode 11 reaches final.Nagual
Still happening in Xcode 11.1Carlstrom
I got the same warnings. I didn't even use AVFoundation framework. I just used NSSound and NSSound.play() in Cocoa.Olvan
I don't even do something with audio, only MIDI, and I also get these warnings on Xcode 12.2. My app is working fine though, so I guess you can just ignore it and it's maybe a bug of Apple.Rosaliarosalie
i used audiotoolbox to test it if it invoke that warning. it did not. i wrote at here : #58279650Tremble

© 2022 - 2024 — McMap. All rights reserved.