In the environment where the AKSettings.channelCount = 2
an AKMicrophone
recording is output to a single channel. So, I'd like to be able to understand how to properly patch or mix the audio in AudioKit
, please?
Let's look at the following example, have in mind that I kept it to the bare minimal, so look at it as "pseudo-code", as follows:
AKSettings.bufferLength = .medium
AKSettings.channelCount = 2
AKSettings.setSession(category: .playAndRecord)
AKNodeRecorder(node: microphone) // or AKMicrophone >>> AKMixer
mainMixer.connect(input: mic) // is AKMixer()
AudioKit.output = mainMixer
AudioKit.start()
The player (AKPlayer) setup is quite simple:
player.load(audioFile: audioFile)
player.isLooping = false
player.buffering = .always
player >>> mainMixer
Resulting in the recorded microphone audio
to be "panned" left, or played in the left channel! I'd rather be certain about how it works, to be able to make the correct choices, since in an analogue mixer the microphone would be patched to a mono channel, centre in the mix, unless panned left/right. Also, I don't want to change the AKSettings.channelCount
to 1
, as I'd like to have audio tracks outputting stereo too.