Gapless looping on iOS

Any idea why the Gapless looping checkbox might be disabled? I am developing an iOS game with Unity and iOS basic license. I have created an mp3 background music file and the gapless looping checkbox is disabled. I have read that mp3 always have a bit silence at the beginning of the track. That is something I hear when the music loops. The only things that I am able to modify are the properties Audio Format (Compressed MPEG), 3D sound, Force to Mono, Load Type (streaming from disk, tried the others as well) and hardware decoding.

Any idea why the gapless looping is disabled? Thanks!!

Just found the answer myself! :slight_smile:

When you have created your background music which should loop. Try to export it as a WAV file, not MP3.

Next, load the WAV file into a Unity Audio Clip. The Audio clip properties show you the Audio format WAV. In my case this means that the WAV file which is 12MB is in memory. Now the trick: select MPEG from the drop down list.

As you will notice all of the other properties become available. File size suddenly drops to 2.7 MB and gapless looping is enabled!

When I tried this in the game the Audio source properties need to be set to loop. And bingo! Perfect loop, no space in front or after the sound and still low in memory usage. Perfect!

If you use white noise (or just look at file size) then you can see gapless looping is not really gapless