Speaker

interface Speaker

Provide a interface for speaker

  • Manipulate speaker settings such as volume and (un)muted.

  • Get settings and properties(min/max)

Types

Link copied to clipboard
enum Rate : Enum<Speaker.Rate>
Link copied to clipboard
data class SpeakerSettings(var volume: Int?, var mute: Boolean?)
Link copied to clipboard
enum Type : Enum<Speaker.Type>

Functions

Link copied to clipboard
abstract fun adjustVolume(deltaVolume: Int): Boolean
Link copied to clipboard
abstract fun getDefaultVolumeLevel(): Int?

Get the default volume level of the speaker

Link copied to clipboard
abstract fun getDefaultVolumeStep(): Int?

Get the default volume step of the speaker used when volumeUp/Down.

Link copied to clipboard
open fun getGroup(): String?

Get the group of the speaker

Link copied to clipboard
abstract fun getMaxVolume(): Int?

Get the maximum volume of the speaker.

Link copied to clipboard
abstract fun getMinVolume(): Int?

Get the minimum volume of the speaker.

Link copied to clipboard
abstract fun getSpeakerSettings(): Speaker.SpeakerSettings?

Get the current settings of the speaker

Link copied to clipboard
abstract fun getSpeakerType(): Speaker.Type

Get the type of the speaker. Must be static value.

Link copied to clipboard
abstract fun setMute(mute: Boolean): Boolean

Set the mute of the speaker.

Link copied to clipboard
abstract fun setVolume(volume: Int, rate: Speaker.Rate = Rate.FAST): Boolean

Set the volume of the speaker.