esp32 soundboard project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
585 B

#ifndef _SOUND_H
#define _SOUND_H
#include "Arduino.h"
#include "driver/i2s.h"
#include "hardware.h"
class Sound {
public:
Sound();
void init();
void end();
// void close();
static void play();
// void pause();
static void stop();
int render_sample_block(uint16_t *sample_buf_left, uint16_t *sample_buf_right, int num_samples);
static const i2s_port_t i2s_num = (i2s_port_t)I2S_NUM;
static volatile bool playing;
static void buffer_refill_task(void *pvParameter);
private:
TaskHandle_t xTaskRefillBuffer;
};
#endif /* _SOUND_H */