开发者

How can I preload .mp3 in iOS while playing a song?

Is there any ability to preload a song (the next one in the game) while already playing the other one. I want the second song to start immediately after the first开发者_开发技巧 one. How can I achieve this effect ?


Create a AVQueuePlayer, queue up all the tracks you want. Set the actionAtItemEnd = AVPlayerActionAtItemEndAdvance

This should then play them with no break. If you still get a break, try creating two separate AVPlayers, and then switch between them programmatically.


You can use schedular or timer-NSTimer method to play the song....


You can use SoundMaster engine. It's very easy to use, just uses AVAudioPlayer intelligently. It has handy completion block and music preload ability. It can preload multiple files.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜