0
我只想播放MP3文件的正确频道。 - >左声道,设置体积:0(静音)Android SoundPool左/右音量
我尝试:
public class TestSound {
private SoundPool soundPool;
private int id;
public TestSound(Context context,final float leftVolume, final float rightVolume) {
soundPool = new SoundPool(2, AudioManager.STREAM_MUSIC, 100);
id = soundPool.load(context, R.raw.cat, 1);
soundPool.setOnLoadCompleteListener(new OnLoadCompleteListener() {
public void onLoadComplete(SoundPool arg0, int arg1, int arg2) {
soundPool.play(id, leftVolume, rightVolume, 1, 0, 1f);
};
});
}
}
//execute
new TestSound(getApplicationContext(), 0f, 1.0f); //left vol:0; right:1
不幸的是,所述第一信道(左):非常-非常默默地播放的歌曲(未静音),和第二信道(右)很好。为什么?
Android操作系统:2.3.4
谢谢你的帮忙!