60 void encode(std::vector<float> &sound, std::vector<unsigned char> &output);
67 void decode(std::vector<unsigned char> &sound, std::vector<float> &output);
116 void handleOpusError(
int errorCode,
const std::string &context)
const;
119 bool _rawStreamSet =
false;
120 bool _hasBeenCompressed =
false;
121 unsigned int _maxPacketSize = 4000;
122 OpusEncoder *_encoder =
nullptr;
123 OpusDecoder *_decoder =
nullptr;
126 mutable std::mutex _mutex;
Aggregates logging-related headers.
This file contains the definition of the Packet structure used for storing compressed audio data.
Defines the structure representing an audio sample.
Class responsible for managing audio compression and decompression.
void decompress()
Decompress the compressed audio stream.
const Audio::Sample & getUncompressedStream() const
Get the uncompressed audio stream.
void decode(std::vector< unsigned char > &sound, std::vector< float > &output)
Decode compressed audio data into raw format.
void compress()
Compress the uncompressed audio stream.
void setUncompressedStream(const Audio::Sample &data)
Set the uncompressed audio stream.
void setMaxPacketSize(const unsigned int maxPacketSize)
Set the maximum packet size for compression.
void encode(std::vector< float > &sound, std::vector< unsigned char > &output)
Encode raw audio data into compressed format.
void setCompressedStream(const Compressor::Packet &data)
Set the compressed audio stream.
const unsigned int getMaxPacketSize() const
Get the maximum packet size for compression.
const Compressor::Packet & getCompressedStream() const
Get the compressed audio stream.
Manager()
Default constructor.
Structure representing an audio sample.
Structure representing a packet of compressed audio data.