Proper background music looping

It’s pretty easy to make an audio clip loop so that when it ends, it loops back to the beginning. How can I make it instead loop back to a specific loop point? Can some audio file types have the loop points incorporated or will I have to do it all within Unity?

Im not well versed in AudioClip Manipulation but you will have to build a new Audio Clip with your specific section you want Looped and then play that back to the User.

Use that class to take Audio from a File and then get the samples you want looped and then rebuild a new audio clip to play as the loop.

Thats the basic theory i understand about it.

Hope it helps.

Check out AudioSource documentation. I believe what you want is possible.

You could check if it has stopped by checking the isPlaying bool. If between frames it went from true to false, it has ended. Make sure loop is off though or you won’t know. In fact if you know it should be playing all the time, if its false you will know.

@Warlyte This Introloop plugin will do exactly what you want : http://forum.unity3d.com/threads/378370/ You can give each audio 2 boundary points and it will loop to the first when it reaches the second.