R5AudioController.setPlaybackGain can be used to adjust the playback volume of a stream. The range is from 0.0 to 1.0.
- Begin by publishing to stream1 from a second device. stream1 is the default stream1 name that is used by this example.
- Use the slider UI to adjust the playback volume of the stream.
R5AudioController.setPlaybackGain: takes a value from 0.0 to 1.0. In this example, the value is changed based on the user input from the slider control.
slider.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
float value = i/100f;
Log.d("Subscriber", ":setVolume=" + value);
subscribe.audioController.setPlaybackGain(value);
}
}