bolar_2 backup
This commit is contained in:
27
main/audio/packed_opus_reader.h
Normal file
27
main/audio/packed_opus_reader.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
namespace borla {
|
||||
|
||||
class PackedOpusReader final {
|
||||
public:
|
||||
PackedOpusReader(const uint8_t* data, size_t size);
|
||||
|
||||
bool Next(const uint8_t** frame, size_t* frame_size);
|
||||
bool valid() const { return valid_; }
|
||||
bool complete() const;
|
||||
uint16_t frame_count() const { return frame_count_; }
|
||||
uint16_t frames_read() const { return frames_read_; }
|
||||
|
||||
private:
|
||||
const uint8_t* data_ = nullptr;
|
||||
size_t size_ = 0;
|
||||
size_t offset_ = 0;
|
||||
uint16_t frame_count_ = 0;
|
||||
uint16_t frames_read_ = 0;
|
||||
bool valid_ = false;
|
||||
};
|
||||
|
||||
} // namespace borla
|
||||
Reference in New Issue
Block a user