BufferedAudioSink.h 607 B

12345678910111213141516171819202122232425
  1. #ifndef BUFFEREDAUDIOSINK_H
  2. #define BUFFEREDAUDIOSINK_H
  3. #include <vector>
  4. #include <iostream>
  5. #include "AudioSink.h"
  6. #include <stdio.h>
  7. #include <string.h>
  8. #include <sys/unistd.h>
  9. #include <sys/stat.h>
  10. #include "esp_err.h"
  11. #include "esp_log.h"
  12. class BufferedAudioSink : public AudioSink
  13. {
  14. public:
  15. void feedPCMFrames(const uint8_t *buffer, size_t bytes) override;
  16. bool setParams(uint32_t sampleRate, uint8_t channelCount, uint8_t bitDepth) override;
  17. protected:
  18. void startI2sFeed(size_t buf_size = 4096 * 8);
  19. void feedPCMFramesInternal(const void *pvItem, size_t xItemSize);
  20. private:
  21. };
  22. #endif