3 #include "AudioTools/AudioCodecs/AudioCodecsBase.h"
4 #include "AudioTools/AudioCodecs/CodecWAV.h"
5 #include "AudioTools/AudioCodecs/CodecMP3Helix.h"
6 #include "AudioTools/AudioCodecs/CodecAACHelix.h"
25 p_out_stream = &out_stream;
30 p_out_stream = &out_stream;
50 if (p_decoder!=
nullptr){
57 return p_decoder !=
nullptr ? p_decoder->
audioInfo() : noInfo;
61 size_t write(
const uint8_t *data,
size_t len) {
62 LOGD(
"%s: %zu", LOG_METHOD, len);
63 if (p_decoder ==
nullptr) {
67 return p_decoder->write(data, len);
71 operator bool() {
return p_decoder ==
nullptr ? false : *p_decoder; }
75 Print *p_out_stream =
nullptr;
81 if (start[0] == 0xFF && start[1] == 0xF1) {
83 LOGI(
"using AACDecoderHelix");
84 }
else if (start[0] == 0xFF || start[0] == 0xFE || strncmp(
"ID3", (
const char*)start, 3)==0) {
86 LOGI(
"using MP3DecoderHelix");
87 }
else if (strncmp(
"RIFF", (
const char*)start, 4)==0) {
89 LOGI(
"using WAVDecoder");
92 if (p_decoder ==
nullptr) {
93 LOGW(
"Unknown Data Format: Content will be ignored...")
94 p_decoder = CodecNOP::instance();
102 if (p_decoder !=
nullptr) {