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);
93 if (mp3!=
nullptr) mp3->end();
96 MP3FrameInfo audioInfoEx(){
97 return mp3->audioInfo();
101 MP3FrameInfo i = audioInfoEx();
110 size_t write(
const uint8_t* data,
size_t len)
override {
111 LOGD(
"%s: %zu", LOG_METHOD, len);
112 if (mp3==
nullptr)
return 0;
113 return mp3->write((uint8_t*)data, len);
110 size_t write(
const uint8_t* data,
size_t len)
override {
…}
117 operator bool()
override {
118 return mp3!=
nullptr && (bool) *mp3;
117 operator bool()
override {
…}
121 libhelix::MP3DecoderHelix *driver() {
129 if (mp3!=
nullptr) mp3->setInfoCallback(
infoCallback,
this);
135 if (p_helix!=
nullptr){
141 baseInfo.logInfo(
"MP3DecoderHelix");
142 p_helix->notifyAudioChange(baseInfo);
144 LOGE(
"Wrong Libhelix Version");
150 return mp3->maxFrameSize();
155 mp3->setMaxFrameSize(len);
160 return mp3->maxPCMSize();
165 mp3->setMaxPCMSize(len);
168 libhelix::MP3DecoderHelix *mp3=
nullptr;