我只想在正确的频道播放 mp3 文件。-> 左声道,设置音量:0(静音)
我试过 :
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
不幸的是,第一个通道(左):非常非常安静地播放歌曲(未静音),第二个通道(右)很好。为什么?
安卓操作系统:2.3.4
谢谢你的帮助!