قالب وردپرس درنا توس
Home / IOS Development / IOS – AVAudioEngine realtime frequency modulation

IOS – AVAudioEngine realtime frequency modulation



I'd like to change the incoming signal in real time and send it to the speakers of the iOS devices. I have read that AVAudioEngine can be used for such tasks. But I do not find any documentation or examples of what I would like to achieve.

For testing I have done:

  audioEngine = AVAudioEngine ()

la unitEffect = AVAudioUnitReverb ()
unitEffect.wetDryMix = 50

audioEngine.attach (unitEffect)

audioEngine.connect (audioEngine.inputNode, for: unitEffect, format: null)
audioEngine.connect (unitEffect, to: audioEngine.outputNode, format: null)

audioEngine.prepare ()

and if you press a button, I only do:

  do {
try audioEngine.start ()
} catch {
print (wrong)
}

or audioEngine.stop () .

The reverb effect is applied to the signal and I can hear it working. So now I would like to get rid of the reverb and:

  1. modulate the incoming signal, such as the inverter signal, modulate the frequency, etc. Is there a kind of collection of effects that can be used or the ability to somehow mathematically modulate the frequency?
  2. When I launch on an iOS device, I get the reverb here, but the output is only on the top phone speaker, not the highest bottom. How to change it?

Source link