如何用AVAudioPlayer依次播放多个音频文件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何用AVAudioPlayer依次播放多个音频文件相关的知识,希望对你有一定的参考价值。

参考技术A 用这个delegate吧

AVAudioPlayerDelegate Protocol Reference

audioPlayerDidFinishPlaying:successfully:

Called when a sound has finished playing.
- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag
Parameters

player

The audio player that finished playing.
flag

YES on successful completion of playback; NO if playback stopped because the system could not decode the audio data.

Discussion

This method is not called upon an audio interruption. Rather, an audio player is paused upon interruption—the sound has not finished playing.
Availability

* Available in ios 2.2 and later.

Declared In
AVAudioPlayer.h

多的就不用说了吧,understand撒。本回答被提问者和网友采纳

以上是关于如何用AVAudioPlayer依次播放多个音频文件的主要内容,如果未能解决你的问题,请参考以下文章

如何在 iOS 4 中在后台播放多个音频文件?

使用 AVAudioPlayer 播放多个音频文件

请问js如何实现多个音频文件依次播放,而不是同时播放?如何实现播放制定位置,如音频3秒到10秒之间

如何在 AVAudioPlayer 中循环播放多个音频文件?

使用 AVAudioPlayer 播放多个音频文件

依次播放多个音频片段