2
0

AudioSink.h 663 B

12345678910111213141516171819202122232425
  1. #ifndef AUDIOSINK_H
  2. #define AUDIOSINK_H
  3. #include <cstdint>
  4. #include <cstdlib>
  5. #include <vector>
  6. class AudioSink
  7. {
  8. public:
  9. AudioSink() {}
  10. virtual ~AudioSink() {}
  11. virtual void feedPCMFrames(const uint8_t *buffer, size_t bytes) = 0;
  12. virtual void volumeChanged(uint16_t volume) {}
  13. // Return false if the sink doesn't support reconfiguration.
  14. virtual bool setParams(uint32_t sampleRate, uint8_t channelCount, uint8_t bitDepth) { return false; }
  15. // Deprecated. Implement/use setParams() instead.
  16. virtual inline bool setRate(uint16_t sampleRate) {
  17. return setParams(sampleRate, 2, 16);
  18. }
  19. bool softwareVolumeControl = true;
  20. bool usign = false;
  21. };
  22. #endif