AudioContainer.h 535 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include <cstddef>
  3. #include <cstring>
  4. #include <istream>
  5. #include "CodecType.h"
  6. #include "StreamInfo.h"
  7. namespace bell {
  8. class AudioContainer {
  9. protected:
  10. std::istream& istr;
  11. public:
  12. bell::SampleRate sampleRate;
  13. bell::BitWidth bitWidth;
  14. int channels;
  15. AudioContainer(std::istream& istr) : istr(istr) {}
  16. virtual std::byte* readSample(uint32_t& len) = 0;
  17. virtual void consumeBytes(uint32_t len) = 0;
  18. virtual void parseSetupData() = 0;
  19. virtual bell::AudioCodec getCodec() = 0;
  20. };
  21. } // namespace bell