3 #include "AudioTools/AudioCodecs/AudioCodecsBase.h"
4 #include "AACDecoderHelix.h"
21 aac =
new libhelix::AACDecoderHelix();
23 aac->setReference(
this);
25 LOGE(
"Not enough memory for libhelix");
35 aac =
new libhelix::AACDecoderHelix(out_stream);
37 aac->setReference(
this);
39 LOGE(
"Not enough memory for libhelix");
52 aac =
new libhelix::AACDecoderHelix(out_stream);
54 aac->setReference(
this);
56 LOGE(
"Not enough memory for libhelix");
67 if (aac!=
nullptr)
delete aac;
78 if (aac!=
nullptr) aac->setOutput(out_stream);
93 virtual void end()
override {
95 if (aac!=
nullptr) aac->end();
98 virtual _AACFrameInfo audioInfoEx(){
99 return aac->audioInfo();
104 auto i = audioInfoEx();
113 if(info_notifications_active){
114 notifyAudioChange(info);
119 size_t write(
const uint8_t* data,
size_t len)
override {
120 LOGD(
"AACDecoderHelix::write: %d", (
int)len);
121 if (aac==
nullptr)
return 0;
124 uint8_t *data8 = (uint8_t*)data;
126 int act_write = aac->write(data8+processed, min(open, DEFAULT_BUFFER_SIZE));
128 processed += act_write;
134 virtual operator bool()
override {
135 return aac!=
nullptr && (bool)*aac;
145 if (p_helix!=
nullptr){
152 LOGW(
"sample_rate: %d", i.sampRateOut);
159 return aac->maxFrameSize();
164 aac->setMaxFrameSize(len);
167 void setAudioInfoNotifications(
bool active){
168 info_notifications_active = active;
173 return aac->maxPCMSize();
178 aac->setMaxPCMSize(len);
182 libhelix::AACDecoderHelix *aac=
nullptr;
183 bool info_notifications_active =
true;