如何只选择左侧或右侧的盖子,然后将所选声音播放到耳机?
答案 0 :(得分:1)
假设SoundPool
没问题,您可以使用:
SoundPool pool = new SoundPool(1, AudioManager.STREAM_NOTIFICATION, 0);
pool.play(
pool.load(this, R.raw.my_sound_effect, 1), // The sound effect to play
0, // The volume for the left channel (0.0 - 1.0)
1.0f, // The volume for the right channel (0.0 - 1.0)
0, // Default priority
0, // Do not loop
1.0f); // Playback rate (1.0f == normal)