I have a car device, and mediaplayer there.
I want to adjust volume with slider, but have a problem.
My debug function:
private void debugVolumeVariables() {
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
if (audioManager == null) {
Log.d(stvar, "No AudioManager");
return;
}
volumeLevel_current = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
Log.d(stvar, "Volume current: "+volumeLevel_current);
for (int i=0;i<=8;i++) {
Log.d(stvar, "Stream: "+i+" current "+audioManager.getStreamVolume(i)+" max "+audioManager.getStreamMaxVolume(i));
}
}
and I have output:
2020-11-24 15:19:15.0889 Volume current: 15
2020-11-24 15:19:15.0899 Stream: 0 current 15 max 15
2020-11-24 15:19:15.0902 Stream: 1 current 15 max 15
2020-11-24 15:19:15.0904 Stream: 2 current 15 max 15
2020-11-24 15:19:15.0907 Stream: 3 current 15 max 15
2020-11-24 15:19:15.0910 Stream: 4 current 15 max 15
2020-11-24 15:19:15.0912 Stream: 5 current 15 max 15
2020-11-24 15:19:15.0915 Stream: 6 current 15 max 15
2020-11-24 15:19:15.0919 Stream: 7 current 15 max 15
2020-11-24 15:19:15.0921 Stream: 8 current 15 max 15
I can't check isVolumeFixed
because of API 19.
When I use native play control of the car, than I see volume level 11 from 50.
Where I can adjust volume else? Any other places?