4 #include "AudioCodecs/AudioEncoded.h"
5 #include "AudioMetaData/MetaDataFilter.h"
6 #include "MP3DecoderHelix.h"
23 mp3 =
new libhelix::MP3DecoderHelix();
25 mp3->setReference(
this);
28 LOGE(
"Not enough memory for libhelix");
38 mp3 =
new libhelix::MP3DecoderHelix();
40 mp3->setReference(
this);
43 LOGE(
"Not enough memory for libhelix");
57 mp3 =
new libhelix::MP3DecoderHelix();
59 mp3->setReference(
this);
62 LOGE(
"Not enough memory for libhelix");
73 if (mp3!=
nullptr)
delete mp3;
78 if (mp3!=
nullptr) mp3->setOutput(outStream);
85 mp3->setDelay(CODEC_DELAY_MS);
95 if (mp3!=
nullptr) mp3->end();
98 MP3FrameInfo audioInfoEx(){
99 return mp3->audioInfo();
103 MP3FrameInfo i = audioInfoEx();
112 size_t write(
const void* mp3Data,
size_t len) {
113 LOGD(
"%s: %zu", LOG_METHOD, len);
114 if (mp3==
nullptr)
return 0;
115 return use_filter ? filter.
write((uint8_t*)mp3Data, len): mp3->write((uint8_t*)mp3Data, len);
120 return mp3!=
nullptr && (bool) *mp3;
123 libhelix::MP3DecoderHelix *driver() {
131 if (mp3!=
nullptr) mp3->setInfoCallback(
infoCallback,
this);
137 if (p_helix!=
nullptr){
143 baseInfo.logInfo(
"MP3DecoderHelix");
144 p_helix->notifyAudioChange(baseInfo);
146 LOGE(
"Wrong Libhelix Version");
162 return mp3->maxFrameSize();
167 mp3->setMaxFrameSize(len);
172 return mp3->maxPCMSize();
177 mp3->setMaxPCMSize(len);
180 libhelix::MP3DecoderHelix *mp3=
nullptr;
182 bool use_filter =
false;