开发者

Playing audio that is retrieved from url

I am getting a list of songs and its corresponding images from a url.The url is a json url.开发者_如何学Python When i click the list a corresponding song is played. I have used AVFoundation Framework to play the song. Now the issue is that i need to play the next song after the playing of first song is completed. The corresponding images also must load. If i click the next or previous button the corresponding songs must be played. What is the best possible mechanism to attain it???

I have read about the Audio Queues and Audio Units but not sure how to use them. I'll be really helpful if i am provided with some sample code of how to do it.


The easiest thing is to just place an If statement in audioPlayerDidFinishPlaying which is what is called after each sound is played (if playing them with an AVAudioPlayer).

You can also use that to update whatever images you need to as well based on the name.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜