#ifndef _SOUND_H #define _SOUND_H #include "Arduino.h" #include "driver/i2s.h" #define I2S_NUM 0 typedef struct { int16_t buf[512]; int len; int index; int playing; } i2sbuffer_t; class Sound { public: Sound(); void init(); void end(); void loop(); // void close(); void play(); // void pause(); void stop(); private: i2sbuffer_t buffer; const i2s_port_t i2s_num = (i2s_port_t)I2S_NUM; }; #endif /* _SOUND_H */