- Home /
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!!
Answer by Serve_Hermans · Jan 18, 2012 at 01:39 PM
Just found the answer myself! :-)
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!
This doesn't seem to work for me. I dragged wav files into the Project folder and although the Audio Format shows WAV now, Hardware decoding and Gapless looping is still greyed out/disabled. There is no $$anonymous$$PEG in the drop down list, only Native (WAV), and Compressed (OGGVORBIS). What am I doing wrong? I am on Unity 3.5f5 btw.
any ideas anyone? There is no $$anonymous$$PEG in Unity 3.5 on $$anonymous$$ac?
this didnt work for me.... have 2 audio clips, one after the other and still hear a delay between both.
Answer by AdbC99 · Jul 11, 2012 at 12:25 AM
If you use white noise (or just look at file size) then you can see gapless looping is not really gapless