当前位置: 代码迷 >> Android >> 请问一个有关问题 soundPool 音量很小
  详细解决方案

请问一个有关问题 soundPool 音量很小

热度:62   发布时间:2016-05-01 17:56:30.0
请教一个问题 soundPool 音量很小
本人做了个英文发音词典,里面的声音文件在电脑播放很大声,在仿真器里面播放也很大声,可是到了我的MB525+里面就很小声,几乎要把脑袋贴在扬声器上才听到,可是在程序里面我已经设置了最大的音量了,请问该怎么处理
下面是我的播放代码
Java code
public void playFile(String voice)    {        try        {            SoundPool sp=new SoundPool(1,AudioManager.STREAM_MUSIC,100);            AssetFileDescriptor asd=getAssets().openFd(voice);            sp.load(asd, 1);            mgr=(AudioManager)this.getSystemService(Context.AUDIO_SERVICE);            float max_Vol=MogherActivity.this.mgr.getStreamMaxVolume(AudioManager.STREAM_MUSIC);            sp.setOnLoadCompleteListener(new OnLoadCompleteListener(){                @Override                public void onLoadComplete(SoundPool arg0, int arg1, int arg2) {                    ((SoundPool)arg0).play(arg1, max_Vol, max_Vol, 1, 0, 1f);                }});        }        catch(IOException e)        {            e.printStackTrace();        }        }//end playFile


------解决方案--------------------
SoundPool有bug