Search code examples
iossignal-processingavaudioplayercore-audioaudiokit

Audiokit Cross Fade sound for loop


I am reproducing a sound through AudioKit player. It is a rain sound of 1 minute. I would like to reproduce it for long timing using loop property = true.

I would like to reach the best possibile experience for my user, but at the moment they can detect a discontinuity in reproduction where sound restarts.

How can I implement a cross fading between the signal itself in order to produce an appearing continuous signal?


Solution

  • It was sufficient to setup two AkAudioPlayers and a Mixer with both them.

    Then setup a timer when first finishing, starting the second and apply a volume fade on both them