MP3Decoder.h 618 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include <stdint.h> // for uint8_t, uint32_t, int16_t
  3. #include "BaseCodec.h" // for BaseCodec
  4. #include "mp3dec.h" // for HMP3Decoder, MP3FrameInfo
  5. namespace bell {
  6. class AudioContainer;
  7. class MP3Decoder : public BaseCodec {
  8. private:
  9. HMP3Decoder mp3;
  10. int16_t* pcmData;
  11. MP3FrameInfo frame = {};
  12. public:
  13. MP3Decoder();
  14. ~MP3Decoder();
  15. bool setup(uint32_t sampleRate, uint8_t channelCount,
  16. uint8_t bitDepth) override;
  17. bool setup(AudioContainer* container) override;
  18. uint8_t* decode(uint8_t* inData, uint32_t& inLen, uint32_t& outLen) override;
  19. };
  20. } // namespace bell