I am developing a game for IOS using sprite kit. i am adding background music now using AVAudioPlayer to play through the game, i want the music play rate to accelerate and decelerate according to events in the app. Is it possible in IOS to change the RATE of music being played in the app and Not just to skip forward? How?
Best How To :
Sure you can manipulate your AVAudioPlayer's rate property.
One thing to note, before changing the rate property you need to enable rate for the player:
audioPlayer.enableRate = YES;
audioPlayer.rate = 2.; //play audio at 2 times the speed.
The range is from 0.5 to 2.
For more information: https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVAudioPlayerClassReference/index.html#//apple_ref/occ/instp/AVAudioPlayer/rate