3 #include "AudioConfig.h"
4 #include "AudioTools/CoreAudio/BaseStream.h"
5 #include "FEC/ReedSolomon/rs.hpp"
16 template <
int bytecount,
int additional_
bytes>
29 int availableForWrite()
override {
33 size_t write(
const uint8_t* data,
size_t len)
override {
34 if (p_print==
nullptr)
return 0;
35 for (
int j=0;j<len;j++){
38 rs.Encode(raw.
data(), encoded.
data());
39 p_print->write(encoded.
data(), bytecount+additional_bytes);
46 int available()
override {
50 size_t readBytes(uint8_t* data,
size_t len)
override{
51 if (p_stream==
nullptr)
return 0;
52 if (encoded.isEmpty()){
53 int read_len = bytecount + additional_bytes;
54 p_stream->readBytes(encoded.
data(), read_len);
65 Stream* p_stream =
nullptr;
66 Print* p_print =
nullptr;