5#ifndef MAX_ZERO_READ_COUNT
6#define MAX_ZERO_READ_COUNT 3
9#ifndef CHANNEL_SELECT_BUFFER_SIZE
10#define CHANNEL_SELECT_BUFFER_SIZE 256
36 if (transform ==
nullptr) {
37 LOGE(
"transform is NULL");
41 LOGE(
"p_stream is NULL");
47 LOGD(
"TransformationReader::readBytes: %d", (
int)len);
53 LOGE(
"p_stream is NULL");
65 LOGD(
"TransformationReader::readBytes: %d -> %d", (
int)len,
result_len);
78 LOGD(
"TransformationReader::available: %d", available_bytes);
120 LOGD(
"setupBuffers: %d", (
int)len);
122 if (byte_factor <= 0.0f) {
123 LOGE(
"Invalid byte factor: %f", byte_factor);
128 int size = (0.5f / byte_factor * len);
131 if (size <= 0) size = 4;
133 LOGI(
"read size: %d", size);
152 LOGD(
"fillResultQueue: %d", (
int)len);
158 LOGE(
"fillResultQueue: result_queue_buffer too small: %d < %d. "
159 "Increase result_queue_factor or call resizeReadResultQueue().",
170 LOGE(
"fillResultQueue: result_queue full (%d) but target not reached "
171 "(%d/%d). Increase result_queue_factor or call "
172 "resizeReadResultQueue().",
178 LOGD(
"readBytes from source: %d -> %d", read_size,
read_eff);
258 LOGD(
"ReformatBaseStream::readBytes: %d", (
int)len);
259 return reader.readBytes(data, len);
263 return reader.available();
465 for (
int j = 0;
j <
vector.size();
j++) {
471 for (
int j = 0;
j <
vector.size();
j++) {
477 for (
auto& out :
vector) {
485 int written = out->write(copy + start, open);
494 for (
int j = 0;
j <
vector.size();
j++) {
506 if (
tmp !=
nullptr &&
tmp->isDeletable()) {
709 int toread = min(1024, open);
719 if (bytes_per_second > 0) {
723 LOGE(
"AudioInfo not defined");
750 for (
auto&
ch : out.channels) {
768 def.p_audio_info = &out;
780 def.p_audio_info = &out;
816 def.p_audio_info = &out;
829 def.p_audio_info = &out;
835 LOGD(
"write %d", (
int)len);
855 result.
channels = info.channels.size();
870 template <
typename T>
873 int sample_count = size /
sizeof(
T);
875 T* data = (
T*)buffer;
877 for (
int i = 0; i < sample_count; i +=
cfg.
channels) {
882 for (
auto&
ch : out.channels) {
891 if (out.buffer.availableForWrite() <
sizeof(
out_frame)) {
892 out.p_out->write(out.buffer.data(), out.buffer.available());
#define CHANNEL_SELECT_BUFFER_SIZE
Definition AudioIO.h:10
#define MAX_ZERO_READ_COUNT
Definition AudioIO.h:6
#define TRACED()
Definition AudioLoggerIDF.h:31
#define LOGI(...)
Definition AudioLoggerIDF.h:28
#define LOGD(...)
Definition AudioLoggerIDF.h:27
#define LOGE(...)
Definition AudioLoggerIDF.h:30
#define DEFAULT_BUFFER_SIZE
Definition avr.h:20