简体   繁体   English

同时使用android媒体播放器播放多个mp3文件。 它跳到列表中的最后一个mp3

[英]Playing Multiple mp3 files using android media player , at the same time . it jumps to the last mp3 on the list

I want to play 16 mp3 all together using android media player lib , these mp3 are saved locally in zip file . 我想使用android media player lib一起播放16 mp3,这些mp3保存在本地zip文件中。 i am facing problem in android 5 and above .The problem is it only play's the last ,mp3 in the list , pausing and playing each mp3 after preparing is not a proper solution , i Need help .i have scratched my head for months now , its really ugly considering there is no error . 我在android 5及更高版本中面临问题。问题是仅播放列表中的最后一个mp3,在准备后暂停并播放每个mp3都不是正确的解决方案,我需要帮助。我已经摸爬了几个月了,考虑到没有错误,这真的很丑。 length of the sounds is huge ,sound pool is not an option . 声音的长度很大,声音池不是一个选择。 below lolipop it seems to work fine . 在lolipop以下,它似乎工作正常。 When debugged it seems to work fine , my guess is anroid art trying to screw with it , considering before 5 it use dalvik 经过调试后,它似乎可以正常工作,我想这是一幅试图将其拧紧的环形艺术,考虑到它在5年前使用dalvik

public void musicstart(int id) {
            switch (id) {

            case R.id.rain:
                player.setVolume(value, value);
                player.setLooping(true);
                player.start();

                break;

}}

this particular method i run it in loop which plays sound which are being selected , max can be 16 at once . 这种特殊的方法我循环运行它播放被选择的声音,一次最多可以达到16个。 i have already prepared them . 我已经准备好了。

我通过将.mp3文件转换为.ogg解决了此问题,并且一次可以播放多个.ogg文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM