Looping audio on iOS with explicit loop and loop points

I am developing an iOS application that resembles a musical instrument.

I try to loop sound patterns to make them infinitely infinite. A simple cycle is not sufficient in this case, since the samples have a β€œattack” section: each sample has a part at the beginning that should not be looped. Therefore, I need to somehow loop only a certain part of the sound sample.

I found several iOS sound libraries (like ObjectAL), but they all seem to only support a simple loop, without the ability to set loop points and loops.

Are they any iOS audio libraries that support this feature? Otherwise, what would be the best way to implement it? (Audio devices? Audio queues? Some other tricks with existing libraries?)

Thanks!

+4
source share
1 answer

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

+1
source

All Articles