audiokit

iOS: Process audio from AVPlayer video track

房东的猫 提交于 2019-12-05 01:41:43
问题 I plan to refactor my recording system in My iOS app. Context: Up to now, I record video and audio separately, starting recording both approximatly at same time. Once record is finished, same system, I play the video and audio separately, applying AudioUnits on the fly on audio. Finally, I merge the video and modified audio. It happens that both records don't start at the same time (for any reasons), producing an unsynchronized result. Would it be possible to refactor my system like this: 1)

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

青春壹個敷衍的年華 提交于 2019-12-05 01:35:47
问题 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:

Read note from MIDI file using AudioKit

白昼怎懂夜的黑 提交于 2019-12-04 20:02:54
问题 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

AudioKit - How to get Real Time floatChannelData from Microphone?

落花浮王杯 提交于 2019-12-04 17:02:55
I'm new to Audiokit and I'm trying to do some real-time digital signal processing on input audio from the microphone. I know the data I want is in AKAudioFile's FloatChannelData, but what if I want to obtain this in real-time? I'm currently using AKMicrophone, AKFrequencyTracker, AKNodeOutputPlot, AKBooster and I'm plotting the tracker's amplitude data. However, that data is not the same as the audio signal (as you know, it's the RMS). Is there any way I can obtain the signal's Float data from the mic? Or even from the AKNodeOutputPlot? I just need read-access. AKSettings.audioInputEnabled =

AudioKit FFT conversion to dB?

南楼画角 提交于 2019-12-04 12:33:34
问题 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

AKRhodesPiano error (crush) on AudioKit v4.2

会有一股神秘感。 提交于 2019-12-04 09:08:47
I'm using AudioKit version 4.2 and I receive this error (see attached image) after installing my app on my phone (iPhone X) - Xcode error when using AKRhodesPiano The error is thrown after the app is compiled and installed (after the app is being opened on the device). This is the line that I'm using: let pianoNote = AKRhodesPiano() // error When I change this line to a different instrument, for example - let pianoNote = AKPluckedString() // works good! Can someone help me figure it out? Some of the STK Physical models got screwed up on a recent release. We're hoping to have it resolved in

How to save audio file with AudioKit?

孤者浪人 提交于 2019-12-04 05:27:10
I have audio file. I made some effects on it let pitchshifter = AKPitchShifter(self.audioPlayer) pitchshifter.shift = 10 AudioKit.output = pitchshifter It works if I play it in app, but I want to save it as a new file to use it as avasset later. How it can be implemented? I tried using AKNodeRecorder but this produces empty audio track: let url = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!.appendingPathComponent("recorded") let format = AVAudioFormat(commonFormat: .pcmFormatFloat64, sampleRate: 44100, channels: 2, interleaved: false)! let tape = try!

How to reduce noise while recording with AudioKit

穿精又带淫゛_ 提交于 2019-12-04 03:39:51
问题 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)

Swift: Sound-Output & Microphone-Input | using AudioKit |

浪子不回头ぞ 提交于 2019-12-03 21:56:45
问题 I'm using > Xcode Version 9.2 < I'm using > AudioKit Version 4.0.4 < I've written some code you can find below that should be able to play a specific sound (frequency: 500.0HZ) "listen" to the microphone input and calculating the frequency in real time If I'm calling playSound() or receiveSound() separated everything looks fine and is really working as I expected. But calling playSound() and receiveSound() afterwards? Exactly there I got big issues. This is how I'd like to get the code

AudioKit iOS - receivedMIDINoteOn function

大城市里の小女人 提交于 2019-12-03 20:52:45
I'm trying to use the receivedMIDINoteOn function to flash a UILabel when the sequencer is playing a note. I have tried using the AKMIDIListener protocol with no success. Also I have made a sub class of AKMIDISampler and send midi to it from the sequencer. It plays the midi but the receivedMIDINoteOn is not called. This is what I have in the init() of the conductor: init() { [ahSampler, beeSampler, gooSampler,flasher] >>> samplerMixer AudioKit.output = samplerMixer AudioKit.start() let midi = AKMIDI() midi.createVirtualPorts() midi.openInput("Session 1") midi.addListener(self) } The conductor