VorbisDecoder.h 625 B

12345678910111213141516171819202122232425
  1. // Copyright (c) Kuba Szczodrzyński 2022-1-14.
  2. #pragma once
  3. #include "BaseCodec.h"
  4. #include "ivorbiscodec.h"
  5. class VorbisDecoder : public BaseCodec {
  6. private:
  7. vorbis_info *vi = nullptr;
  8. vorbis_comment *vc = nullptr;
  9. vorbis_dsp_state *vd = nullptr;
  10. ogg_packet op = {};
  11. int16_t *pcmData;
  12. public:
  13. VorbisDecoder();
  14. ~VorbisDecoder();
  15. bool setup(uint32_t sampleRate, uint8_t channelCount, uint8_t bitDepth) override;
  16. uint8_t *decode(uint8_t *inData, uint32_t inLen, uint32_t &outLen) override;
  17. bool setup(BaseContainer *container) override;
  18. private:
  19. void setPacket(uint8_t *inData, uint32_t inLen) const;
  20. };