Skip to content

Commit

Permalink
[speaker] Document mute actions and audio dac support (#4378)
Browse files Browse the repository at this point in the history
  • Loading branch information
kahrendt authored Oct 23, 2024
1 parent 8e03ff0 commit febc428
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 7 deletions.
1 change: 1 addition & 0 deletions components/speaker/i2s_audio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Configuration variables:
- ``pcm_short``
- ``pcm_long``
- **timeout** (*Optional*, :ref:`config-time`): How long to wait after finishing playback before releasing the bus. Defaults to ``100ms``.
- All other options from :ref:`Speaker Component <config-speaker>`.

External DAC
************
Expand Down
44 changes: 37 additions & 7 deletions components/speaker/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,28 @@ speaker platforms.
Base Speaker Configuration
--------------------------

No configuration variables
.. code-block:: yaml
speaker:
- platform: ...
Configuration variables:

- **audio_dac** (*Optional*, :ref:`config-id`): The :doc:`audio DAC </components/audio_dac/index>` to use for volume control.

.. _speaker-actions:

Speaker Actions
------------------
---------------

All ``speaker`` actions can be used without specifying an ``id`` if you have only one ``speaker`` in
your configuration YAML.

.. _speaker-play:

``speaker.play`` Action
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^

This action will start playing raw audio data from the speaker.

Expand All @@ -52,7 +60,7 @@ Configuration variables:
.. _speaker-stop:

``speaker.stop`` Action
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^

This action will stop playing audio data from the speaker and discard the unplayed data.

Expand All @@ -65,7 +73,29 @@ Configuration variables:
``speaker.finish`` Action
^^^^^^^^^^^^^^^^^^^^^^^^^

This action will stop playing audio data from the speaker after all data **is** played.
This action will stop playing audio data from the speaker after all data **is** played.

Configuration variables:

- **id** (*Optional*, :ref:`config-id`): The speaker to control. Defaults to the only one in YAML.

.. _speaker-mute_on:

``speaker.mute_on`` Action
^^^^^^^^^^^^^^^^^^^^^^^^^^

This action will mute the speaker.

Configuration variables:

- **id** (*Optional*, :ref:`config-id`): The speaker to control. Defaults to the only one in YAML.

.. _speaker-mute_off:

``speaker.mute_off`` Action
^^^^^^^^^^^^^^^^^^^^^^^^^^^

This action will unmute the speaker.

Configuration variables:

Expand All @@ -74,7 +104,7 @@ Configuration variables:
.. _speaker-volume_set:

``speaker.volume_set`` Action
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This action will set the volume of the speaker.

Expand Down Expand Up @@ -107,7 +137,7 @@ your configuration YAML.
.. _speaker-is_playing:

``speaker.is_playing`` Condition
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This condition will check if the speaker is currently playing audio data.

Expand Down

0 comments on commit febc428

Please sign in to comment.