bolar_2 backup
This commit is contained in:
31
main/audio/opus_frame_decoder.h
Normal file
31
main/audio/opus_frame_decoder.h
Normal 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
|
||||
Reference in New Issue
Block a user