SoundPool问题???
SoundPool soundPool;
public void initsound(){
soundPool=new SoundPool(4,AudioManager.STREAM_MUSIC,1);
soundPool.load(this,R.raw.th,1);
}
public void play(int loop){
AudioManager mgr=(AudioManager)this.getSystemService(Context.AUDIO_SERVICE);
float streamVolume=mgr.getStreamVolume(AudioManager.STREAM_MUSIC);
float streamVolumeMax=mgr.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
float volume=streamVolume/streamVolumeMax;
soundPool.play(R.raw.th, volume, volume, 1, loop, 1f);
}
这两个方法有问题吗??
...全文
相关推荐
使用 SoundPool 同时播放多个音频
使用 SoundPool 同时播放多个音频 具体详情请参见 http://blog.csdn.net/aduovip/article/details/14695779
Android使用SoundPool实现播放音频
主要为大家详细介绍了Android使用SoundPool实现播放音频,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
SoundPool 的使用
一个简单的sample , 用来理解及测试SoundPool的相关功能 相关博客 https://blog.csdn.net/qq_28261343/article/details/82818868
Media soundpool的使用
Media soundpool的使用,解决视频有声音没图形的情况
SoundPool实例Demo
soundPool在Android5.0后Api有了改变,这个Demo就是为解决这种变化的,它可以在Android4.+----7.+系统正常播放音频文件!


