MUSE PROTO board

Gain could be set by changing the state of GPIO 23

please see this topic :

I have not tried it yet but you could use :

esphome:
  on_boot:
    priority: 10
    then:
     - lambda: |-
          gpio_reset_pin(GPIO_NUM_23);
          gpio_set_direction(GPIO_NUM_23, GPIO_MODE_OUTPUT);           
          gpio_set_pull_mode(GPIO_NUM_23, GPIO_PULLDOWN_ONLY);

media_player:
  - platform: i2s_audio
    id: media_out
    name: ${device} player
    dac_type: external
    i2s_lrclk_pin: GPIO25
    i2s_dout_pin: GPIO26
    i2s_bclk_pin: GPIO5
    mode: mono
    mute_pin:
      number: GPIO21
      inverted: true