问题描述
我要玩多个MP3文件,在序列(一前一后),使用AVAudioPlayer。我试了一下,打第一台MP3后停止。但是,如果我去到调试,它工作正常..任何想法?我读的地方AVAudioPlayer在后台播放音频..我怎么prevent它这样做呢?
输精管
I want to play multiple MP3 files, in sequence (one after the other) , using AVAudioPlayer. I tried it, and it stops after playing the first MP3. However, if I go into debugger, it works fine.. any ideas? I read somewhere AVAudioPlayer plays audio in the background.. how do I prevent it from doing this?Vas
推荐答案
我想的 AVQueuePlayer
(子类 AVPlayer
)正是这样做的作业(播放项目的顺序),因为iOS 4.1的:
http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVQueuePlayer_Class/Reference/Reference.html
I think the AVQueuePlayer
(subclass of AVPlayer
) does exactly this job (play a sequence of items) since iOS 4.1 :http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVQueuePlayer_Class/Reference/Reference.html
我没有尝试,但我自己却肯定会给一个尝试吧。
I didn't try it myself however but will definitely give a try to it.
这篇关于AVAudioPlayer - 播放多个音频文件,按顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!