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
謝謝你的幫忙!