ES8388
The es8388 component allows your ESPHome devices to use the es8388 low power audio codec (datasheet)
This allows the playback of audio through two channel high performance audio DAC output via the microcontroller from a range of sources via Speaker or
Media Player.
It also allows your ESPHome devices to use the es8388 high performance two channel audio ADC.
This allows attached microphones to be used as a microphone input via I2S Audio.
The I²C bus is required in your configuration as this is used to communicate with the es8388.
Audio DAC
Section titled “Audio DAC”# Example configuration entryaudio_dac: - platform: es8388Configuration variables
Section titled “Configuration variables”- address (Optional, int): The I²C address of the driver. Defaults to
0x10. - i2c_id (Optional): The ID of the I²C bus the ES8388 is connected to.
- All other options from Audio DAC.
Select
Section titled “Select”The es8388 select allows you to control the dac output and the adc input_mic of your Es8388.
select: - platform: es8388 es8388_id: es8388_parent dac_output: name: "DAC Output" adc_input_mic: name: "ADC Input MIC"Configuration variables
Section titled “Configuration variables”-
es8388_id (Optional, ID): Manually specify the ID for the Es8388 component.
-
dac_output (Optional): Control the DAC Audio output.
LINE1(default)LINE2BOTH
All options from Select.
-
adc_input_mic (Optional): Control the ADC Mic Input.
LINE1(default)LINE2DIFFERENCE
All options from Select.
Automations
Section titled “Automations”All Audio DAC Automations are supported by this platform.
Configuration Examples
Section titled “Configuration Examples”ESP32 Audio Kit:
i2c: sda: GPIO33 scl: GPIO32 frequency: 100kHz id: bus_a
audio_dac: - platform: es8388 id: es8388_dac
select: - platform: es8388 es8388_id: es8388_dac dac_output: name: "DAC Output" adc_input_mic: name: "ADC Input MIC"
i2s_audio: id: i2s_output i2s_lrclk_pin: GPIO25 i2s_bclk_pin: GPIO27 i2s_mclk_pin: GPIO0
speaker: - platform: i2s_audio i2s_audio_id: i2s_output sample_rate: 48000 id: speaker_id i2s_dout_pin: GPIO26 bits_per_sample: 32bit dac_type: external channel: stereo buffer_duration: 100ms audio_dac: es8388_dac
microphone: - platform: i2s_audio i2s_din_pin: GPIO35 id: mic1 adc_type: external pdm: false sample_rate: 16000 bits_per_sample: 16bit
switch: - platform: gpio pin: GPIO21 id: mute_switch name: "AMP Switch" restore_mode: ALWAYS_ON