setVolume

fun setVolume(@FloatRange(from = 0.0, to = 1.0) volume: Float = 1.0f): Boolean

Sets the playback volume.

Return

true if the volume is set successfully; false otherwise. If volume is out of range, this returns false.

Parameters

volume

The audio volume in the range [0.0f, 1.0f].