How can I set the volume of 2 simultaneously playing mediaplayer objects using a single seekbar?
when the seekbar goes to left the volume of one song should increase and volume of other song should decrease.
I tried using the mp.setVolume method for this purpose but no use. As far as I know, using AudioManager , the stream music is set. This means that if two songs are being played then both the songs would either have an increase in the volume or would have a decrease. Is there any other way? here's my code:
@Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
if(progress==progress--)
{
int volume=volumeSeekbar.getMax()-progress;
mp.setVolume(volume, volume);
mp1.setVolume(progress,progress);
//audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, progress, 0);
}
}
Thanks in advance.