BufferedAudioSink.h 624 B

123456789101112131415161718192021222324252627
  1. #ifndef BUFFEREDAUDIOSINK_H
  2. #define BUFFEREDAUDIOSINK_H
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <sys/stat.h>
  6. #include <sys/unistd.h>
  7. #include <iostream>
  8. #include <vector>
  9. #include "AudioSink.h"
  10. #include "esp_err.h"
  11. #include "esp_log.h"
  12. class BufferedAudioSink : public AudioSink {
  13. public:
  14. void feedPCMFrames(const uint8_t* buffer, size_t bytes) override;
  15. bool setParams(uint32_t sampleRate, uint8_t channelCount,
  16. 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