I canβt say if this is the best solution, but for my loops that have intro / outro ... I use several .caf files that are combined: one for input, one for loop and one for auto.
After input, the loop starts and plays until the event lights up, due to which the sound stops looping and ends, and then it automatically plays when the sound of the loop ends.
I use Audacity to edit audio files to make sure they blend perfectly.
Edit:
My application uses cocos2d, so I use the cocosDehension audio library, as it is built into cocos2d. As long as the sound file has been correctly edited, it is automatically cleared without clicks or pop-ups.
Here's a link to the technique I used in Audacity to make sure the file is looped without clicks:
http://forum.audacityteam.org/viewtopic.php?f=13&t=2820#p11073
source share