~aleteoryx/muditaos

ref: fd9d45423d6239294ff873045daaa856bf7cbe30 muditaos/module-audio/Audio/decoder/DecoderWAV.hpp -rw-r--r-- 573 bytes
fd9d4542 — Maciej Gibowicz [BH-1883] Add a low battery notification on home screen with quotes 1 year, 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (c) 2017-2024, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "Decoder.hpp"
#include <src/dr_wav.h>

namespace audio
{
    class DecoderWAV : public Decoder
    {
      public:
        explicit DecoderWAV(const std::string &filePath);
        ~DecoderWAV();

        std::int32_t decode(std::uint32_t samplesToRead, std::int16_t *pcmData) override;

        void setPosition(float pos) override;

      private:
        std::unique_ptr<drwav> wav;
    };
} // namespace audio