Files
MuditaOS/module-audio/Audio/decoder/decoderWAV.hpp
Lucjan Bryndza cbbcbe2a04 [EGD-8076] Replace wav decoder by dr_wav
Replace plain straigh waw decoder by the dr_wav library.

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-12-09 15:23:56 +01:00

36 lines
778 B
C++

// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include "Decoder.hpp"
#include <vector>
namespace audio
{
namespace internal
{
struct wavContext;
}
class decoderWAV : public Decoder
{
public:
explicit decoderWAV(const char *fileName);
virtual ~decoderWAV();
uint32_t decode(uint32_t samplesToRead, int16_t *pcmData) override;
void setPosition(float pos) override;
private:
auto getBitWidth() -> unsigned int override;
std::vector<int32_t> pcmsamplesbuffer;
std::unique_ptr<internal::wavContext> decoderContext;
uint32_t bitsPerSample;
};
} // namespace audio