#pragma once #include #include #include struct OpusDecoder; namespace borla { class OpusFrameDecoder final { public: OpusFrameDecoder() = default; ~OpusFrameDecoder(); bool Initialize(uint32_t sample_rate, uint8_t channels); bool Decode( const uint8_t* encoded, size_t encoded_size, int16_t* pcm, size_t pcm_capacity, size_t* decoded_samples); void Reset(); private: std::mutex mutex_; OpusDecoder* decoder_ = nullptr; uint8_t channels_ = 1; }; } // namespace borla