diff --git a/_audio_encoded_8h_source.html b/_audio_encoded_8h_source.html
index 74f93de07..2c2bea50e 100644
--- a/_audio_encoded_8h_source.html
+++ b/_audio_encoded_8h_source.html
@@ -514,7 +514,7 @@
-
+
@@ -548,8 +548,8 @@
-
-
+
+
diff --git a/_audio_i_o_8h_source.html b/_audio_i_o_8h_source.html
index 7e397eb4a..163cb5190 100644
--- a/_audio_i_o_8h_source.html
+++ b/_audio_i_o_8h_source.html
@@ -184,648 +184,647 @@
127 Vector<uint8_t> buffer{0};
128 T *p_transform =
nullptr;
- 130 int result_queue_factor = 10;
- 131 int result_queue_size = 0;
-
-
- 137 Print *result = p_transform->getPrint();
- 138 p_transform->setOutput((
Print &)result_queue);
-
-
-
-
- 145 if (out) p_transform->setOutput(*out);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 171 virtual void setOutput(AudioOutput &print) {
-
-
-
-
-
-
-
-
-
-
- 182 virtual Print *getPrint() {
return p_print; }
-
- 184 virtual Stream *getStream() {
return p_stream; }
-
- 186 size_t readBytes(uint8_t *data,
size_t len)
override {
- 187 LOGD(
"ReformatBaseStream::readBytes: %d", (
int)len);
- 188 return reader.readBytes(data, len);
-
-
- 191 int available()
override {
- 192 return DEFAULT_BUFFER_SIZE;
-
-
- 195 int availableForWrite()
override {
- 196 return DEFAULT_BUFFER_SIZE;
-
-
- 199 virtual float getByteFactor() = 0;
-
- 201 void end()
override {
-
-
-
-
-
-
-
-
-
- 212 Stream *p_stream =
nullptr;
- 213 Print *p_print =
nullptr;
-
-
- 216 if (getStream() !=
nullptr) {
- 217 reader.
begin(
this, getStream());
-
-
-
-
-
-
-
-
-
-
- 236 size_t write(
const uint8_t *data,
size_t len) {
- 237 return p_print->write(data, len);
-
-
-
-
- 243 Print *p_print =
nullptr;
-
-
-
-
-
-
-
-
- 256 void setStream(
AudioStream &stream) { p_stream = &stream; }
-
-
-
-
-
- 262 size_t write(
const uint8_t *data,
size_t len)
override {
- 263 return p_stream->write(data, len);
-
-
- 266 int availableForWrite()
override {
return p_stream->availableForWrite(); }
-
- 268 bool begin()
override {
return p_stream->begin(); }
-
- 270 void end()
override { p_stream->end(); }
-
-
-
- 275 operator bool()
override {
return *p_stream; }
-
-
- 278 AudioStream *p_stream =
nullptr;
-
-
-
-
-
-
-
-
- 291 void setOutput(
AudioOutput &stream) { p_stream = &stream; }
-
-
-
-
-
- 297 size_t write(
const uint8_t *data,
size_t len)
override {
- 298 return p_stream->write(data, len);
-
-
- 301 bool begin()
override {
return p_stream->begin(); }
-
- 303 void end()
override { p_stream->end(); }
-
-
-
- 308 operator bool()
override {
return *p_stream; }
-
-
- 311 AudioOutput *p_stream =
nullptr;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 352 for (
int j = 0; j < vector.size(); j++) {
-
-
-
-
-
-
-
-
-
-
-
- 366 vector.push_back(out);
-
-
-
-
- 371 vector.push_back(out);
-
-
-
- 375 for (
int j = 0; j < vector.size(); j++) {
-
-
-
-
-
- 381 for (
int j = 0; j < vector.size(); j++) {
- 382 vector[j]->setAudioInfo(info);
-
-
-
- 386 size_t write(
const uint8_t *data,
size_t len) {
- 387 for (
int j = 0; j < vector.size(); j++) {
-
-
-
- 391 int written = vector[j]->write(data + start, open);
-
-
-
-
-
-
-
- 399 size_t write(uint8_t ch) {
- 400 for (
int j = 0; j < vector.size(); j++) {
-
-
- 403 open -= vector[j]->write(ch);
-
-
-
-
-
-
- 410 Vector<AudioOutput *> vector;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 446 start_ms = startSeconds * 1000;
- 447 calculateByteLimits();
-
-
-
-
- 453 calculateByteLimits();
-
-
-
- 459 end_ms = endSeconds * 1000;
- 460 calculateByteLimits();
-
-
-
-
- 466 calculateByteLimits();
-
-
-
- 471 if (current_bytes < start_bytes)
return false;
- 472 if (end_bytes > 0 && current_bytes > end_bytes)
return false;
-
-
-
-
- 478 return (current_bytes < end_bytes && current_bytes >= start_bytes);
-
-
-
-
-
-
-
- 486 bool begin()
override {
- 487 calculateByteLimits();
-
- 489 LOGI(
"byte range %u - %u",(
unsigned) start_bytes,(
unsigned) end_bytes);
-
-
-
- 493 operator bool() {
return isActive(); }
-
-
-
- 500 if (p_stream ==
nullptr)
return 0;
-
- 502 if (start_bytes > current_bytes){
- 503 consumeBytes(start_bytes - current_bytes);
-
-
-
-
-
-
- 510 result = p_stream->readBytes(data, len);
- 511 current_bytes += len;
-
- 513 }
while (result > 0 && current_bytes < start_bytes);
-
-
-
- 518 size_t write(
const uint8_t *data,
size_t len)
override {
- 519 if (current_bytes >= end_bytes)
return 0;
- 520 current_bytes += len;
- 521 if (current_bytes < start_bytes)
return len;
- 522 return p_print->write(data, len);
-
-
-
- 527 if (p_stream ==
nullptr)
return 0;
- 528 return current_bytes < end_bytes ? p_stream->available() : 0;
-
-
-
-
-
- 535 calculateByteLimits();
-
-
- 538 int availableForWrite()
override {
- 539 return current_bytes < end_bytes ? p_print->availableForWrite() : 0;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 575 return end_bytes - start_bytes;
-
-
-
- 579 Stream *p_stream =
nullptr;
- 580 Print *p_print =
nullptr;
- 581 AudioInfoSupport *p_info =
nullptr;
- 582 uint32_t start_ms = 0;
- 583 uint32_t end_ms = UINT32_MAX;
- 584 uint32_t start_bytes = 0;
- 585 uint32_t end_bytes = UINT32_MAX;
- 586 uint32_t current_bytes = 0;
- 587 float compression_ratio = 1.0;
-
- 589 void consumeBytes(uint32_t len){
-
- 591 uint8_t buffer[1024];
-
- 593 int toread = min(1024, open);
- 594 p_stream->readBytes(buffer, toread);
-
-
- 597 current_bytes += len;
- 598 LOGD(
"consumed %u -> %u",(
unsigned) len, (
unsigned)current_bytes);
-
-
- 601 void calculateByteLimits() {
-
- 603 if (bytes_per_second > 0) {
- 604 start_bytes = bytes_per_second * start_ms / compression_ratio / 1000;
- 605 end_bytes = bytes_per_second * end_ms / compression_ratio / 1000;
-
- 607 LOGE(
"AudioInfo not defined");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 631 AudioOutput::begin();
-
- 633 for (
auto &out : out_channels) {
- 634 for (
auto &ch : out.channels) {
-
- 636 LOGE(
"Channel '%d' not valid for max %d channels", ch, cfg.
channels);
-
-
-
-
-
-
-
-
-
- 648 channels.push_back(channel);
-
- 650 def.channels = channels;
-
- 652 def.p_audio_info = &out;
- 653 out_channels.push_back(def);
-
-
-
-
- 660 channels.push_back(channel);
-
- 662 def.channels = channels;
-
- 664 def.p_audio_info = &out;
- 665 out_channels.push_back(def);
-
-
-
-
- 672 channels.push_back(channel);
-
- 674 def.channels = channels;
-
- 676 out_channels.push_back(def);
-
-
-
-
- 683 channels.push_back(left);
- 684 channels.push_back(right);
-
- 686 def.channels = channels;
-
- 688 out_channels.push_back(def);
-
-
-
-
- 695 channels.push_back(left);
- 696 channels.push_back(right);
-
- 698 def.channels = channels;
-
- 700 def.p_audio_info = &out;
- 701 out_channels.push_back(def);
-
-
-
-
- 708 channels.push_back(left);
- 709 channels.push_back(right);
-
- 711 def.channels = channels;
-
- 713 def.p_audio_info = &out;
- 714 out_channels.push_back(def);
-
-
- 717 size_t write(
const uint8_t *data,
size_t len)
override {
- 718 if (!is_active)
return false;
- 719 LOGD(
"write %d", (
int)len);
-
-
- 722 return writeT<int16_t>(data, len);
-
- 724 return writeT<int24_t>(data, len);
-
- 726 return writeT<int32_t>(data, len);
-
-
-
-
-
-
-
-
- 735 for (
auto &info : out_channels) {
- 736 auto p_notify = info.p_audio_info;
- 737 if (p_notify !=
nullptr) {
-
-
- 740 p_notify->setAudioInfo(result);
-
-
-
-
-
-
- 747 Print *p_out =
nullptr;
-
-
-
-
-
-
- 754 template <
typename T>
- 755 size_t writeT(
const uint8_t *buffer,
size_t size) {
- 756 if (!is_active)
return 0;
- 757 int sample_count = size /
sizeof(T);
-
- 759 T *data = (T *)buffer;
-
- 761 for (
int i = 0; i < sample_count; i += cfg.
channels) {
-
- 763 for (
auto &out : out_channels) {
- 764 T out_frame[out.channels.size()] = {0};
-
- 766 for (
auto &ch : out.channels) {
-
-
- 769 out_frame[ch_out++] = frame[channel];
-
-
- 772 size_t written = out.buffer.writeArray((
const uint8_t *)&out_frame,
sizeof(out_frame));
-
- 774 if (out.buffer.availableForWrite()<
sizeof(out_frame)){
- 775 out.p_out->write(out.buffer.data(), out.buffer.available());
-
-
-
-
-
-
-
-
-
-
-
- 788 for (
auto &channels_select : out_channels) {
- 789 if (channels_select.p_out == out)
return channels_select.channels.size();
-
- 791 return defaultChannels;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 130 int result_queue_factor = 5;
+
+
+ 136 Print *result = p_transform->getPrint();
+ 137 p_transform->setOutput((
Print &)result_queue);
+
+
+
+
+ 144 if (out) p_transform->setOutput(*out);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 170 virtual void setOutput(AudioOutput &print) {
+
+
+
+
+
+
+
+
+
+
+ 181 virtual Print *getPrint() {
return p_print; }
+
+ 183 virtual Stream *getStream() {
return p_stream; }
+
+ 185 size_t readBytes(uint8_t *data,
size_t len)
override {
+ 186 LOGD(
"ReformatBaseStream::readBytes: %d", (
int)len);
+ 187 return reader.readBytes(data, len);
+
+
+ 190 int available()
override {
+ 191 return DEFAULT_BUFFER_SIZE;
+
+
+ 194 int availableForWrite()
override {
+ 195 return DEFAULT_BUFFER_SIZE;
+
+
+ 198 virtual float getByteFactor() = 0;
+
+ 200 void end()
override {
+
+
+
+
+
+
+
+
+
+ 211 Stream *p_stream =
nullptr;
+ 212 Print *p_print =
nullptr;
+
+
+ 215 if (getStream() !=
nullptr) {
+ 216 reader.
begin(
this, getStream());
+
+
+
+
+
+
+
+
+
+
+ 235 size_t write(
const uint8_t *data,
size_t len) {
+ 236 return p_print->write(data, len);
+
+
+
+
+ 242 Print *p_print =
nullptr;
+
+
+
+
+
+
+
+
+ 255 void setStream(
AudioStream &stream) { p_stream = &stream; }
+
+
+
+
+
+ 261 size_t write(
const uint8_t *data,
size_t len)
override {
+ 262 return p_stream->write(data, len);
+
+
+ 265 int availableForWrite()
override {
return p_stream->availableForWrite(); }
+
+ 267 bool begin()
override {
return p_stream->begin(); }
+
+ 269 void end()
override { p_stream->end(); }
+
+
+
+ 274 operator bool()
override {
return *p_stream; }
+
+
+ 277 AudioStream *p_stream =
nullptr;
+
+
+
+
+
+
+
+
+ 290 void setOutput(
AudioOutput &stream) { p_stream = &stream; }
+
+
+
+
+
+ 296 size_t write(
const uint8_t *data,
size_t len)
override {
+ 297 return p_stream->write(data, len);
+
+
+ 300 bool begin()
override {
return p_stream->begin(); }
+
+ 302 void end()
override { p_stream->end(); }
+
+
+
+ 307 operator bool()
override {
return *p_stream; }
+
+
+ 310 AudioOutput *p_stream =
nullptr;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 351 for (
int j = 0; j < vector.size(); j++) {
+
+
+
+
+
+
+
+
+
+
+
+ 365 vector.push_back(out);
+
+
+
+
+ 370 vector.push_back(out);
+
+
+
+ 374 for (
int j = 0; j < vector.size(); j++) {
+
+
+
+
+
+ 380 for (
int j = 0; j < vector.size(); j++) {
+ 381 vector[j]->setAudioInfo(info);
+
+
+
+ 385 size_t write(
const uint8_t *data,
size_t len) {
+ 386 for (
int j = 0; j < vector.size(); j++) {
+
+
+
+ 390 int written = vector[j]->write(data + start, open);
+
+
+
+
+
+
+
+ 398 size_t write(uint8_t ch) {
+ 399 for (
int j = 0; j < vector.size(); j++) {
+
+
+ 402 open -= vector[j]->write(ch);
+
+
+
+
+
+
+ 409 Vector<AudioOutput *> vector;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 445 start_ms = startSeconds * 1000;
+ 446 calculateByteLimits();
+
+
+
+
+ 452 calculateByteLimits();
+
+
+
+ 458 end_ms = endSeconds * 1000;
+ 459 calculateByteLimits();
+
+
+
+
+ 465 calculateByteLimits();
+
+
+
+ 470 if (current_bytes < start_bytes)
return false;
+ 471 if (end_bytes > 0 && current_bytes > end_bytes)
return false;
+
+
+
+
+ 477 return (current_bytes < end_bytes && current_bytes >= start_bytes);
+
+
+
+
+
+
+
+ 485 bool begin()
override {
+ 486 calculateByteLimits();
+
+ 488 LOGI(
"byte range %u - %u",(
unsigned) start_bytes,(
unsigned) end_bytes);
+
+
+
+ 492 operator bool() {
return isActive(); }
+
+
+
+ 499 if (p_stream ==
nullptr)
return 0;
+
+ 501 if (start_bytes > current_bytes){
+ 502 consumeBytes(start_bytes - current_bytes);
+
+
+
+
+
+
+ 509 result = p_stream->readBytes(data, len);
+ 510 current_bytes += len;
+
+ 512 }
while (result > 0 && current_bytes < start_bytes);
+
+
+
+ 517 size_t write(
const uint8_t *data,
size_t len)
override {
+ 518 if (current_bytes >= end_bytes)
return 0;
+ 519 current_bytes += len;
+ 520 if (current_bytes < start_bytes)
return len;
+ 521 return p_print->write(data, len);
+
+
+
+ 526 if (p_stream ==
nullptr)
return 0;
+ 527 return current_bytes < end_bytes ? p_stream->available() : 0;
+
+
+
+
+
+ 534 calculateByteLimits();
+
+
+ 537 int availableForWrite()
override {
+ 538 return current_bytes < end_bytes ? p_print->availableForWrite() : 0;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 574 return end_bytes - start_bytes;
+
+
+
+ 578 Stream *p_stream =
nullptr;
+ 579 Print *p_print =
nullptr;
+ 580 AudioInfoSupport *p_info =
nullptr;
+ 581 uint32_t start_ms = 0;
+ 582 uint32_t end_ms = UINT32_MAX;
+ 583 uint32_t start_bytes = 0;
+ 584 uint32_t end_bytes = UINT32_MAX;
+ 585 uint32_t current_bytes = 0;
+ 586 float compression_ratio = 1.0;
+
+ 588 void consumeBytes(uint32_t len){
+
+ 590 uint8_t buffer[1024];
+
+ 592 int toread = min(1024, open);
+ 593 p_stream->readBytes(buffer, toread);
+
+
+ 596 current_bytes += len;
+ 597 LOGD(
"consumed %u -> %u",(
unsigned) len, (
unsigned)current_bytes);
+
+
+ 600 void calculateByteLimits() {
+
+ 602 if (bytes_per_second > 0) {
+ 603 start_bytes = bytes_per_second * start_ms / compression_ratio / 1000;
+ 604 end_bytes = bytes_per_second * end_ms / compression_ratio / 1000;
+
+ 606 LOGE(
"AudioInfo not defined");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 630 AudioOutput::begin();
+
+ 632 for (
auto &out : out_channels) {
+ 633 for (
auto &ch : out.channels) {
+
+ 635 LOGE(
"Channel '%d' not valid for max %d channels", ch, cfg.
channels);
+
+
+
+
+
+
+
+
+
+ 647 channels.push_back(channel);
+
+ 649 def.channels = channels;
+
+ 651 def.p_audio_info = &out;
+ 652 out_channels.push_back(def);
+
+
+
+
+ 659 channels.push_back(channel);
+
+ 661 def.channels = channels;
+
+ 663 def.p_audio_info = &out;
+ 664 out_channels.push_back(def);
+
+
+
+
+ 671 channels.push_back(channel);
+
+ 673 def.channels = channels;
+
+ 675 out_channels.push_back(def);
+
+
+
+
+ 682 channels.push_back(left);
+ 683 channels.push_back(right);
+
+ 685 def.channels = channels;
+
+ 687 out_channels.push_back(def);
+
+
+
+
+ 694 channels.push_back(left);
+ 695 channels.push_back(right);
+
+ 697 def.channels = channels;
+
+ 699 def.p_audio_info = &out;
+ 700 out_channels.push_back(def);
+
+
+
+
+ 707 channels.push_back(left);
+ 708 channels.push_back(right);
+
+ 710 def.channels = channels;
+
+ 712 def.p_audio_info = &out;
+ 713 out_channels.push_back(def);
+
+
+ 716 size_t write(
const uint8_t *data,
size_t len)
override {
+ 717 if (!is_active)
return false;
+ 718 LOGD(
"write %d", (
int)len);
+
+
+ 721 return writeT<int16_t>(data, len);
+
+ 723 return writeT<int24_t>(data, len);
+
+ 725 return writeT<int32_t>(data, len);
+
+
+
+
+
+
+
+
+ 734 for (
auto &info : out_channels) {
+ 735 auto p_notify = info.p_audio_info;
+ 736 if (p_notify !=
nullptr) {
+
+
+ 739 p_notify->setAudioInfo(result);
+
+
+
+
+
+
+ 746 Print *p_out =
nullptr;
+
+
+
+
+
+
+ 753 template <
typename T>
+ 754 size_t writeT(
const uint8_t *buffer,
size_t size) {
+ 755 if (!is_active)
return 0;
+ 756 int sample_count = size /
sizeof(T);
+
+ 758 T *data = (T *)buffer;
+
+ 760 for (
int i = 0; i < sample_count; i += cfg.
channels) {
+
+ 762 for (
auto &out : out_channels) {
+ 763 T out_frame[out.channels.size()] = {0};
+
+ 765 for (
auto &ch : out.channels) {
+
+
+ 768 out_frame[ch_out++] = frame[channel];
+
+
+ 771 size_t written = out.buffer.writeArray((
const uint8_t *)&out_frame,
sizeof(out_frame));
+
+ 773 if (out.buffer.availableForWrite()<
sizeof(out_frame)){
+ 774 out.p_out->write(out.buffer.data(), out.buffer.available());
+
+
+
+
+
+
+
+
+
+
+
+ 787 for (
auto &channels_select : out_channels) {
+ 788 if (channels_select.p_out == out)
return channels_select.channels.size();
+
+ 790 return defaultChannels;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
@@ -834,7 +833,7 @@
-
+