1

I am using AudioKit for microphone calibration. Mine code is as below:

class Manager: NSObject {

    var mic: AKMicroPhone!
    var tracker: AKFrequencyTracker!
    var silence: AKBooster!
    var defaultGain = 0.25
    init() {
        super.init()
        AKSettings.audioInputEnabled = true
        mic = AKMicrophone()

        // An instance of AKFrequencyTracker() what will track the pitch of signal
        tracker = AKFrequencyTracker(mic)

        // An instance of AKBooster() which is AudioKit version of Apple’s Mixer Node. The gain parameter is an amplification factor (Default: 1, Minimum: 0).
        silence = AKBooster(tracker, gain: defaultGain)
        }

    func startCalibration() {
        AudioKit.output = silence
        do {
            try AudioKit.start()
        } catch {
            print(error)
        }
    }

}

So, the startCalibration() is my function for starting microphone calibration to measure frequency. But while using this function there is sound coming from my mobile speakers it is similar to the input voice.

kchopda
  • 312
  • 4
  • 16

0 Answers0