Volume, muting, and sound settings.
{:ok, [%{"volume" => 12, "maxVolume" => 100}]} = Bravia.Audio.get_volume_information(tv)
:ok = Bravia.Audio.set_volume(tv, 20)
:ok = Bravia.Audio.set_volume(tv, "+1")Televisions routing sound to an external amplifier over eARC may report a volume
they do not actually control. Check get_volume_information/1 before assuming a
write will be audible.
Summary
Functions
Reads sound settings such as the output terminal or sound mode.
Reads speaker settings, such as the front speaker configuration.
Reads each output's volume, mute state, and range.
Mutes or unmutes the television.
Writes sound settings, in the same shape as Bravia.Video.set_picture_quality_settings/2.
Writes speaker settings.
Sets the volume.
Functions
@spec get_sound_settings(Bravia.Client.t(), String.t()) :: {:ok, [map()]} | {:error, Bravia.Error.t()}
Reads sound settings such as the output terminal or sound mode.
@spec get_speaker_settings(Bravia.Client.t(), String.t()) :: {:ok, [map()]} | {:error, Bravia.Error.t()}
Reads speaker settings, such as the front speaker configuration.
@spec get_volume_information(Bravia.Client.t()) :: {:ok, [map()]} | {:error, Bravia.Error.t()}
Reads each output's volume, mute state, and range.
[%{"target" => "speaker", "volume" => 12, "mute" => false,
"minVolume" => 0, "maxVolume" => 100}]
@spec set_mute(Bravia.Client.t(), boolean()) :: :ok | {:error, Bravia.Error.t()}
Mutes or unmutes the television.
@spec set_sound_settings(Bravia.Client.t(), [map()]) :: :ok | {:error, Bravia.Error.t()}
Writes sound settings, in the same shape as Bravia.Video.set_picture_quality_settings/2.
@spec set_speaker_settings(Bravia.Client.t(), [map()]) :: :ok | {:error, Bravia.Error.t()}
Writes speaker settings.
@spec set_volume(Bravia.Client.t(), non_neg_integer() | String.t(), keyword()) :: :ok | {:error, Bravia.Error.t()}
Sets the volume.
Accepts an absolute level as a non-negative integer, or a relative adjustment as a
string such as "+1" or "-1".
Options
:target— which output to change. Defaults to"speaker". An empty string means whichever output is currently active.