Android - 顺序音频播放?
尝试了 soundpool 和 mediaplayer,但无法完全让声音文件按顺序正确播放而不重叠。需要能够按顺序播放三个随机选择的音频文件而不重叠。有使用 soundpool 顺序播放音频的示例吗?将非常感激..似乎这样一个简单的事情过于复杂..
Tried both soundpool and mediaplayer but cant quite manage to get sound files to play back correctly in sequence without overlap.. Need to be able to playback three randomly selected audio files in sequence without overlap. Any examples of using soundpool to play back audio sequentially? would be very much appreciated.. seems like such a simple thing is overly complicated..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我宁愿建议使用
MediaPlayer
而不是使用SoundPool
,因为使用SoundPool
的目的通常是同时播放多个文件(这会导致重叠。)只需使用
MediaPlayer
对象并应用 OnCompletionListener< /a> 到它。I would rather suggest use
MediaPlayer
instead of usingSoundPool
, since purpose of usingSoundPool
is generally to play multiple files concurrently (which causes overlapping.)Just use a
MediaPlayer
object and apply the OnCompletionListener to it.