Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
550 views
in Technique[技术] by (71.8m points)

ios - How to play multiple audio files in a row with AVAudioPlayer?

I have 5 songs in my app that I would like to play one after the other with AVAudioPlayer.

Are there any examples of this? How can I accomplish this?

Any example code would be greatly appreciated!

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

AVQueuePlayer work for this situation.

AVQueuePlayer is a subclass of AVPlayer you use to play a number of items in sequence.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...