AudioSink.h 705 B

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