So I am having situation where I want to loop a sound and gradually decrease the delay between sounds. Means, sound beep should be played most often as time passing.
Right now, I am using an AVAudioPlayer with a sound which has duration of 1 sec, but the actual sound lasts only 0.5 sec. The other 0.5 sec of the sound is silenced. So when I use numberOfLoops
property and set it to -1 (endless repeating) in combination with rate
property on AVAudioPlayer and change it to some higher value than 1, I get desired result... Still, this is not that ideal, because sound may end up distorted (because of pitch).
I am looking for something like SKAction in SpriteKit for example, where I can run a block of code in after certain delay... What would be an optimal way for doing this in UIKit ?