3 #include "AudioTools/AudioCodecs/AudioCodecsBase.h"
28 p_print = &out_stream;
47 virtual size_t write(
const uint8_t *data,
size_t len)
override {
48 if (p_print ==
nullptr)
50 int16_t *data16 = (int16_t *)data;
51 for (
int j = 0; j < len / 2; j++) {
52 data16[j] = ntohs(data16[j]);
54 return p_print->write((uint8_t *)data, len);
57 virtual operator bool()
override {
return p_print!=
nullptr; }
61 Print *p_print =
nullptr;
87 const char *
mime()
override {
return "audio/l16"; }
90 virtual bool begin()
override { is_open =
true;
return true;}
99 void end()
override { is_open =
false; }
102 virtual size_t write(
const uint8_t *data,
size_t len)
override {
103 if (p_print ==
nullptr)
106 int16_t *data16 = (int16_t *)data;
107 for (
int j = 0; j < len / 2; j++) {
108 data16[j] = htons(data16[j]);
111 return p_print->write((uint8_t *)data, len);
114 operator bool()
override {
return is_open; }
116 bool isOpen() {
return is_open; }
119 Print *p_print =
nullptr;