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() {
return mp3->audioInfo(); }
101 MP3FrameInfo i = audioInfoEx();
102 if (i.nChans != 0 && i.samprate != 0 && i.bitsPerSample != 0) {
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 {
return mp3 !=
nullptr && (bool)*mp3; }
120 libhelix::MP3DecoderHelix *driver() {
return mp3; }
127 if (mp3 !=
nullptr) mp3->setInfoCallback(
infoCallback,
this);
133 if (p_helix !=
nullptr) {
139 baseInfo.logInfo(
"MP3DecoderHelix");
140 p_helix->notifyAudioChange(baseInfo);
142 LOGE(
"Wrong Libhelix Version");
161 libhelix::MP3DecoderHelix *mp3 =
nullptr;