audiokit

What is a correct way to manage AudioKit's lifecycle?

只谈情不闲聊 提交于 2019-12-03 16:19:26
I'm building an app that has to track input amplitude of users mic. AudioKit has a bunch of handy objects for my needs: AKAmplitudeTracker and so. I haven't found any viable info on how is it supposed to start AudioKit, begin tracking etc. For now all code related to AudioKit initialization is in viewDidLoad method of my root VC of audio recorder module. It is not correct, because random errors occur and I can't track whats wrong. Code below shows how I use AudioKit now. var silence: AKBooster! var tracker: AKAmplitudeTracker! var mic: AKMicrophone! ... override func viewDidLoad() { super

Read note from MIDI file using AudioKit

牧云@^-^@ 提交于 2019-12-03 12:54:43
I am trying to build a sequencer that render the note from midi file. Currently I am using AudioKit for the music data processing. Would like to know how can I get the note data / event from the midi file with AudioKit. I have tried to use AKSequencer and output to AKMIDINode to listen the MIDI event, but seems cannot get anything from it. class CustomMIDINode: AKMIDINode { override init(node: AKPolyphonicNode) { print("Node create") // OK super.init(node: node) } func receivedMIDINoteOff(noteNumber: MIDINoteNumber, velocity: MIDIVelocity, channel: MIDIChannel) { print("midi note off") // Not

AudioKit FFT conversion to dB?

孤街浪徒 提交于 2019-12-03 08:20:50
First time posting, thanks for the great community! I am using AudioKit and trying to add frequency weighting filters to the microphone input and so I am trying to understand the values that are coming out of the AudioKit AKFFTTap. Currently I am trying to just print the FFT buffer converted into dB values for i in 0..<self.bufferSize { let db = 20 * log10((self.fft?.fftData[Int(i)])!) print(db) } I was expecting values ranging in the range of about -128 to 0, but I am getting strange values of nearly -200dB and when I blow on the microphone to peg out the readings it only reaches about -60.

How to reduce noise while recording with AudioKit

拟墨画扇 提交于 2019-12-01 19:55:04
I am using AudioKit to record audio and display visualizer while recording and playing audio. It works good, But recorded audio has lots of background noise. Is there any way to reduce noise? Here is the code for prepare recording func prepareForRecording() { AKSettings.defaultToSpeaker = true // Patching outputPlot.node = mic micMixer = AKMixer(mic) micBooster = AKBooster(micMixer) // Microphone monitoring is muted micBooster.gain = 0 // Silent recorder = try? AKNodeRecorder(node: micMixer) if let file = recorder?.audioFile { player = try? AKAudioPlayer(file:file) } player?.completionHandler

AKFFTTap stops generating data after some time

断了今生、忘了曾经 提交于 2019-12-01 12:18:15
I'm using AudioKit for a recorder app, and I added a AKFFTTap to the AKMicrophone for drawing a custom audio waveform. This all works well, but after several recordings, or after some time passes with the app recording screen open, the FFT data suddenly becomes all 0. I know the mic is working and the gains don't change, since the recorded file contains the expected audio. It seems like just the FFT tap stops working all of a sudden. Anyone have any idea why this is and how can I solve it? Thanks! 来源: https://stackoverflow.com/questions/49705736/akffttap-stops-generating-data-after-some-time

Trying to debug mystery sinewave using AKMIDISampler in Audiokit

笑着哭i 提交于 2019-12-01 07:32:53
Following on from a previous issue , I stopped using AKSampler to move to the functionality used in AKMIDISampler . Got my loops working again (with help from this Google Groups post ), but I have a sinewave playing (which happens when the MIDISampler can't find it's source file). It's not an issue with the source files I'm targeting because they all play OK. The sinewave is coming from somewhere else in the process, but I can't see where... Please help 8•) (Simplified and edited code to show only relevant details - please get in touch for any clarification) var MIDISamplePlayer =

Trying to debug mystery sinewave using AKMIDISampler in Audiokit

你。 提交于 2019-12-01 06:01:48
问题 Following on from a previous issue, I stopped using AKSampler to move to the functionality used in AKMIDISampler . Got my loops working again (with help from this Google Groups post), but I have a sinewave playing (which happens when the MIDISampler can't find it's source file). It's not an issue with the source files I'm targeting because they all play OK. The sinewave is coming from somewhere else in the process, but I can't see where... Please help 8•) (Simplified and edited code to show

AudioKit (iOS) - Add observer for frequency / amplitude change

醉酒当歌 提交于 2019-11-29 07:58:15
I'm using the AudioKit framework for developing a small application that is able to listen for the microphone input frequency & amplitude and I want to trigger an event ( obviously I want to trigger a function ) every time the frequency & the amplitude got specific values -> An event for a specific tone. Right now I'm using this simple Swift code for my application: mic = AKMicrophone() tracker = AKFrequencyTracker(mic) silence = AKBooster(tracker, gain: 1) AKSettings.audioInputEnabled = true AudioKit.output = silence AudioKit.start() let t = Timer.scheduledTimer( timeInterval: 0.05, target:

How to apply audio effect to a file and write to filesystem - iOS

橙三吉。 提交于 2019-11-28 11:43:04
I'm building an app that should allow user to apply audio filters to a recorded audio, such as Reverb, Boost. I was unable to find any viable source of information on how to apply filters to a file itself, because it's needed to upload processed file to server later. I'm currently using AudioKit for visualization, and I'm aware that it's capable of doing audio processing, but only for playback. Please give any suggestions for further research. AudioKit has an offline render node that doesn't require iOS 11. Here's an example, the player.schedule(...) and player.start(at.) bits are required as

AudioKit (iOS) - Add observer for frequency / amplitude change

被刻印的时光 ゝ 提交于 2019-11-28 01:49:29
问题 I'm using the AudioKit framework for developing a small application that is able to listen for the microphone input frequency & amplitude and I want to trigger an event ( obviously I want to trigger a function ) every time the frequency & the amplitude got specific values -> An event for a specific tone. Right now I'm using this simple Swift code for my application: mic = AKMicrophone() tracker = AKFrequencyTracker(mic) silence = AKBooster(tracker, gain: 1) AKSettings.audioInputEnabled = true