ios - Track Frequency from Microphone using AudioKit -
creating swift-ios project tracks audio frequency microphone. using audiokit 3.0 framework. have following code working in xcode simulator when run on device doesn't appear reading microphone signal correctly.
// prepare microphone let mic = akmicrophone() // connect microphone high pass filter let mixer = akmixer(mic) let highpassfilter = akhighpassfilter(mic) // set parameters of hi pass filter highpassfilter.cutofffrequency = 7000 // hz highpassfilter.resonance = 0 // db let tracker = akfrequencytracker(highpassfilter, minimumfrequency: 7000, maximumfrequency: 8000) highpassfilter.play() audiokit.audiooutput = tracker audiokit.start() akplaygroundloop(every: 0.1) { let freq = tracker.frequency print(freq) }
i use code audiokit 3 , works fine:
let mic = akmicrophone() amplitudetracker = akamplitudetracker(mic) aksettings.audioinputenabled = true audiokit.output = amplitudetracker audiokit.start() mic.start() amplitudetracker.start() this akamplitudetracker situation same you. try aksettings.audioinputenabled = true
hope helps.
Comments
Post a Comment