2023-05-30 20:44:22 +02:00
I²S Audio Media Player
2022-06-02 07:00:24 +02:00
======================
.. seo ::
2023-04-12 01:53:24 +02:00
:description: Instructions for setting up I²S based media players in ESPHome.
2022-06-02 07:00:24 +02:00
:image: i2s_audio.svg
The `` i2s_audio `` media player platform allows you to play media from webservers and web streams
2023-04-12 01:53:24 +02:00
via the :doc: `/components/i2s_audio` . This platform only works on ESP32 based chips.
2022-06-02 07:00:24 +02:00
.. code-block :: yaml
# Example configuration entry
media_player:
- platform: i2s_audio
name: ESPHome I2S Media Player
dac_type: external
i2s_dout_pin: GPIO22
mode: mono
Configuration variables:
------------------------
2022-08-31 03:55:05 +02:00
- **dac_type** (**Required** , enum):
2022-06-02 07:00:24 +02:00
2022-06-29 22:29:03 +02:00
- `` external `` : Use an external DAC, for example the NS4168, or UDA1334A.
2022-06-02 07:00:24 +02:00
- `` internal `` : Use the internal DAC
- All other options from :ref: `Media Player <config-media_player>`
External DAC
***** ***** **
2023-05-24 21:35:38 +02:00
- **i2s_dout_pin** (**Required** , :ref: `config-pin` ): The GPIO pin to use for the I²S `` DOUT/SDOUT `` *(Data Out)* signal, also referred to as `` SD/SDATA `` *(Serial Data)* or `` DACDAT `` *(Digital to Analog Converter Data)* .
- **mute_pin** (*Optional* , :ref: `Pin Schema <config-pin_schema>` ): The GPIO pin to use to mute the media player.
2023-04-12 01:53:24 +02:00
- **mode** (*Optional* , string): The mode of the I²S bus. Can be `` mono `` or `` stereo `` . Defaults to `` mono `` .
2023-05-08 20:03:36 +02:00
- **i2s_audio_id** (*Optional* , :ref: `config-id` ): The ID of the :ref: `I²S Audio <i2s_audio>` you wish to use for this media player.
2023-06-12 21:48:13 +02:00
- **i2s_comm_fmt** (*Optional* , string): I2S communication format. By default MSB format is used (AC101, PCM5102A).
Set to `` lsb `` if using an external DAC that uses Japanese (Least Significant Bit Justified) format (like PT8211).
Can be `` msb `` or `` lsb `` . Defaults to `` msb `` .
2022-06-02 07:00:24 +02:00
2022-07-05 09:33:03 +02:00
For best results, keep the wires as short as possible.
2022-06-02 07:00:24 +02:00
Internal DAC
***** ***** **
- **mode** (**Required** , enum): The channel mode of the internal DAC.
- `` left ``
- `` right ``
- `` stereo ``
See also
--------
- :doc: `index`
- :ghedit: `Edit`