AudioKit: process iPhone mic input & make processed output available as mic input for use with VOIP framework

Viewed 684

Firstly, hats off to Aure for his impressive work in creating this framework!

My challenge is: I have successfully grabbed my iPhone's mic input using AKMicrophone, and processed it with the AKPitchshifter filter and AKMixer so that I can hear the pitchshifted output in my earphones. Here is the code (processMic() is for testing purposes called from a button tap in my UI):

import AudioKit

var micBooster: AKBooster?

var pitchShifter: AKPitchShifter?


func processMic() {

    let mic = AKMicrophone()

    let micMixer = AKMixer(mic)

    micBooster = AKBooster(micMixer)

    pitchShifter = AKPitchShifter(micBooster, shift: 8)

    micBooster!.gain = 10

    AudioKit.output = pitchShifter

    AudioKit.start()

}

I now want that processed output to become the microphone source for a VOIP framework I am using. Is this likely to be possible? All help gratefully received.

Thanks!

1 Answers

I think what you're going to want to do is to tap a node that contains the source audio that you want. AudioKit offers a number of tap examples:

https://github.com/AudioKit/AudioKit/tree/master/AudioKit/Common/Taps

And you can you even use the way audio plots are made as a guide as well:

https://github.com/AudioKit/AudioKit/blob/master/AudioKit/Common/User%20Interface/AKNodeOutputPlot.swift

This plot grabs the data from a specific node and plots it whereas you'd grab the data and use it as the source buffer from your VOIP component.

Related