这声音如此简单,我想不通,为什么我找不到答案笑
This sound so simple that I can't figure out why I can't find the answer lol
我有一个工作的声音池类(感谢的教程和一些调整,我做了),并能正常工作。
I have a working sound pool class (thanks to a tutorial and some tweaking I did), and it works fine.
现在的问题是,我希望能够随意改变我的背景音乐。 (并不总是有相同的音乐在一个循环中,但有2或3,当一个人完成我玩了2人之一)。
the problem now is that I want to be able to change my background music randomly. (not always have the same music in a loop but have 2 or 3 and when one finishes I play one of the 2 others).
问题是我找不到得到通知的方式,音乐播放完毕。
problem is I can't find a way to get notified that the music has finished playing.
任何想法?
杰森
推荐答案
它不能用的Soundpool据我可以告诉完成的。
It can't be done with SoundPool as far as I can tell.
唯一的声音选手,我知道它可以提供一个完成通知 MediaPlayer的 - 它更是一个复杂的禽兽不如的Soundpool,但允许设置一个OnCompletionListener时通知播放就完成了。
The only audio 'player' that I know which can provide a completion notification is MediaPlayer - it's more of a complex beast than SoundPool but allows setting an OnCompletionListener to be notified when playback is complete.
相关推荐
最新文章