我对 Android 还很陌生,所以要温柔!
我有以下代码,应该(我认为)只是播放“developersshort”。
public constructor(Context context){
this.context = context;
soundPool = new SoundPool(2, AudioManager.STREAM_MUSIC,0);
soundPoolMap = new HashMap<Integer, Integer>();
soundPoolMap.put(1, soundPool.load(this.context,
R.raw.developersshort, 1));
}
public void run() {
soundPool.play(soundPoolMap.get(1), 1, 1, 1, 0, 1f);
}
[为了弄清楚发生了什么,它目前播放史蒂夫鲍尔默反复喊“开发者”的混音!声音文件的大小约为 90KB。]
当我在模拟器中运行我的应用程序并按下按钮触发声音时,它会说“开发人员开发人员开发人员......”等等,就像我所期望的那样。
但是,当我将它部署到我的手机时,我只听到类似“velop”的声音,然后声音就停止了。
我不知道发生了什么,有什么想法吗?
非常感谢!