wofea_v10_hack icon indicating copy to clipboard operation
wofea_v10_hack copied to clipboard

Support I2C Audio

Open nbergont opened this issue 5 years ago • 1 comments

Informations : https://github.com/earlephilhower/ESP8266Audio https://github.com/earlephilhower/ESP8266SAM

nbergont avatar Oct 15 '19 11:10 nbergont

To try

#include "esphome.h"
#include <ESP8266SAM.h>
#include <AudioOutputI2S.h>

class I2sTextSpeech : public Component, public Switch {
  AudioOutputI2S *_out;
  public:
  void setup() override {
    _out = new AudioOutputI2S();
    _out->begin();
  }
  
  void write_state(bool state) override {
    ESP8266SAM *sam = new ESP8266SAM;
    sam->Say(_out, "Hello Word");
    delete sam;
    publish_state(state);
  }
};

nbergont avatar Oct 17 '19 09:10 nbergont