3 #include "AudioTools/AudioCodecs/AudioCodecsBase.h"
4 #include "AudioTools/CoreAudio/AudioMetaData/MetaDataFilter.h"
5 #include "MP3DecoderHelix.h"
22 mp3 =
new libhelix::MP3DecoderHelix();
24 mp3->setReference(
this);
26 LOGE(
"Not enough memory for libhelix");
36 mp3 =
new libhelix::MP3DecoderHelix();
38 mp3->setReference(
this);
40 LOGE(
"Not enough memory for libhelix");
54 mp3 =
new libhelix::MP3DecoderHelix();
56 mp3->setReference(
this);
58 LOGE(
"Not enough memory for libhelix");
69 if (mp3!=
nullptr)
delete mp3;
74 if (mp3!=
nullptr) mp3->setOutput(outStream);
90 if (mp3!=
nullptr) mp3->end();
93 MP3FrameInfo audioInfoEx(){
94 return mp3->audioInfo();
98 MP3FrameInfo i = audioInfoEx();
107 size_t write(
const uint8_t* data,
size_t len) {
108 LOGD(
"%s: %zu", LOG_METHOD, len);
109 if (mp3==
nullptr)
return 0;
110 return mp3->write((uint8_t*)data, len);
115 return mp3!=
nullptr && (bool) *mp3;
118 libhelix::MP3DecoderHelix *driver() {
126 if (mp3!=
nullptr) mp3->setInfoCallback(
infoCallback,
this);
132 if (p_helix!=
nullptr){
138 baseInfo.logInfo(
"MP3DecoderHelix");
139 p_helix->notifyAudioChange(baseInfo);
141 LOGE(
"Wrong Libhelix Version");
147 return mp3->maxFrameSize();
152 mp3->setMaxFrameSize(len);
157 return mp3->maxPCMSize();
162 mp3->setMaxPCMSize(len);
165 libhelix::MP3DecoderHelix *mp3=
nullptr;