I've been struggling with this for some days already now ... :(
I've read these threads: Gapless-MP3-playback, Gapless looping on iOS, Gapless looping on iOS Producing seamless looping mp3s. Also a bit of theory here: mp3Loops
I am doing as instructed: Import WAV files, select MPEG encoding, check the "gapless looping" box
and make it loop:
var gameObject2 = new GameObject("MyObject");
audioSource2 = gameObject2.AddComponent<AudioSource>();
var filename = "test01_1152x";
audioClip2 = Resources.Load (filename) as AudioClip;
audioSource2.clip = audioClip2;
audioSource2.loop = true;
audioSource2.Play();
However the "pop" sound is terribly obvious.
I wonder what am I missing?
Checking "gapless looping" is just a bit better but it does not avoid the "pop" sound 100%. If the file given is wrong or not best for this situation, what conditions should the file fullfill in order to have a nice gapless looping bgm?
These are the pictures of various settings I've tried, including the original wave file
Original Wave: Loops nicely, because it is WAV.
Compressed as MPEG (Non gapless looping selected), "pop" sound is super obvious while listeninig it.
Compressed as MPEG (Gapless looping selected), "pop" sound is still obvious, just a bit better than setting.
It is clearly stated in the manual.
Indeed when you drop an mp3 in to Unity it literally shows an alert that you cannot loop mp3s in Unity.
That's all there is to it.
Same sound as mp3 versus wav:
Obviously it is trivial to convert audio files between formats; use any software on your Mac or PC to do so. (Example, TwistedWave.)
(Note: The discussions in the other answers about how to loop smoothly in an artistic sense, are completely unrelated to the question of Unity3D / mp3 looping - which is trivial, you can't loop an mp3 in Unity.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With