bolar_2 backup

This commit is contained in:
2026-11-27 16:38:11 +08:00
commit e96d6d19df
305 changed files with 43350 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#pragma once
#include <cstddef>
#include <cstdint>
#include <mutex>
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