4 #include "AudioCodecs/AudioEncoded.h"
5 #include "AACDecoderHelix.h"
22 aac =
new libhelix::AACDecoderHelix();
24 aac->setReference(
this);
26 LOGE(
"Not enough memory for libhelix");
36 aac =
new libhelix::AACDecoderHelix(out_stream);
38 aac->setReference(
this);
40 LOGE(
"Not enough memory for libhelix");
53 aac =
new libhelix::AACDecoderHelix(out_stream);
55 aac->setReference(
this);
57 LOGE(
"Not enough memory for libhelix");
68 if (aac!=
nullptr)
delete aac;
71 void setRaw(
bool flag){
72 if (aac!=
nullptr) aac->setRaw(flag);
79 if (aac!=
nullptr) aac->setOutput(out_stream);
86 aac->setDelay(CODEC_DELAY_MS);
94 virtual void end()
override {
96 if (aac!=
nullptr) aac->end();
99 virtual _AACFrameInfo audioInfoEx(){
100 return aac->audioInfo();
105 auto i = audioInfoEx();
114 if(info_notifications_active){
115 notifyAudioChange(info);
120 size_t write(
const void* aac_data,
size_t len)
override {
121 LOGD(
"AACDecoderHelix::write: %d", (
int)len);
122 if (aac==
nullptr)
return 0;
125 uint8_t *data = (uint8_t*)aac_data;
127 int act_write = aac->write(data+processed, min(open, DEFAULT_BUFFER_SIZE));
129 processed += act_write;
135 virtual operator bool()
override {
136 return aac!=
nullptr && (bool)*aac;
146 if (p_helix!=
nullptr){
153 LOGW(
"sample_rate: %d", i.sampRateOut);
160 return aac->maxFrameSize();
165 aac->setMaxFrameSize(len);
168 void setAudioInfoNotifications(
bool active){
169 info_notifications_active = active;
172 #ifdef HELIX_PCM_CORRECTED
175 return aac->maxPCMSize();
180 aac->setMaxPCMSize(len);
185 return aac->maxPWMSize();
190 aac->setMaxPWMSize(len);
195 libhelix::AACDecoderHelix *aac=
nullptr;
196 bool info_notifications_active =
true;