Android无法使用Soundpool播放某些WAV文件? [英] Android can't play some wav file with soundpool?
本文介绍了Android无法使用Soundpool播放某些WAV文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
某些.wav文件我无法与音池一起播放.我什么也听不到.某些文件可以正常播放.为什么?
Some .wav file I can't play with soundpool. I can't hear anything. Some files play just fine. Why?
代码
AudioManager mgr = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
int streamVolume = mgr.getStreamVolume(AudioManager.STREAM_MUSIC);
soundPool.play(soundPoolMap.get(sound), streamVolume, streamVolume, 1, 0, 1f);
推荐答案
我在音池和文件格式方面遇到很多问题.阅读我的原始问题,对您可能会有帮助.
I had lots of problems with soundpool and file formats. Read my original question, it might be helpful to you.
基本上,我更改为使用MediaPlayer,没有更多问题.
Basically, I changed to use MediaPlayer and had no more problems.
这篇关于Android无法使用Soundpool播放某些WAV文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文