We are currently using audio wave files, which loop seamlessly. However, due to the nature of their size, we’d much rather use mp3. But when we do, they fail to produce seamless loops. Is there any way to fix this problem? We really do not want to resort to wave files if possible. We want audio files roughly the size of mp3’s
For anyone reading this in 2017 and onwards, I found that using .ogg files instead of .mp3s works for seamless looping. You can use a free program like Audacity to convert from your source .wav to .ogg.
Obviously this relies on your source audio file actually looping seamlessly in the first place. I used this technique to get seamlessly looping background .ogg files:
- Create or Licence a background music loop to use.
- Use [Winamp] (http://www.winamp.com/) to test whether the music file actually loops seamlessly (I have seen reports that programs like Windows Media Player and others don’t correctly loop audio seamlessly).
- If it loops seamlessly, use Audacity to convert it from .wav to .ogg
- Listen to the .ogg file in Winamp file to test that it still loops perfectly.
- Include the file in your project and get it looping.
- Test it sounds OK on the various platforms you are aiming for (I have seen reports that music may not loop correctly on iOS, but loops fine on Android, or example).
Check out AudioSource.PlayScheduled(double time), it does exactly what you’re wanting by pre-loading the AudioClip.