3#include "AudioTools/AudioCodecs/AudioCodecsBase.h"
7#include "MP3DecoderHelix.h"
24 mp3 =
new libhelix::MP3DecoderHelix();
26 mp3->setReference(
this);
28 LOGE(
"Not enough memory for libhelix");
38 mp3 =
new libhelix::MP3DecoderHelix();
40 mp3->setReference(
this);
42 LOGE(
"Not enough memory for libhelix");
56 mp3 =
new libhelix::MP3DecoderHelix();
58 mp3->setReference(
this);
60 LOGE(
"Not enough memory for libhelix");
71 if (mp3!=
nullptr)
delete mp3;
77 if (mp3!=
nullptr) mp3->setOutput(outStream);
84 LOGE(
"Not enough memory for libhelix");
94 if (mp3!=
nullptr) mp3->end();
97 MP3FrameInfo audioInfoEx(){
98 return mp3->audioInfo();
102 MP3FrameInfo i = audioInfoEx();
111 size_t write(
const uint8_t* data,
size_t len)
override {
112 LOGD(
"%s: %zu", LOG_METHOD, len);
113 if (mp3==
nullptr)
return 0;
114 return mp3->write((uint8_t*)data, len);
118 operator bool()
override {
119 return mp3!=
nullptr && (bool) *mp3;
122 libhelix::MP3DecoderHelix *driver() {
130 if (mp3!=
nullptr) mp3->setInfoCallback(
infoCallback,
this);
136 if (p_helix!=
nullptr){
142 baseInfo.logInfo(
"MP3DecoderHelix");
143 p_helix->notifyAudioChange(baseInfo);
145 LOGE(
"Wrong Libhelix Version");
151 return mp3->maxFrameSize();
156 mp3->setMaxFrameSize(len);
161 return mp3->maxPCMSize();
166 mp3->setMaxPCMSize(len);
169 libhelix::MP3DecoderHelix *mp3=
nullptr;