3#define MINIMP3_NO_STDIO
9#ifndef MINIMP3_MAX_SAMPLE_RATE
10#define MINIMP3_MAX_SAMPLE_RATE 44100
47 pcm.
resize(MINIMP3_MAX_SAMPLES_PER_FRAME);
64 size_t write(
const uint8_t *data,
size_t len) {
65 LOGD(
"write: %zu", len);
85 virtual operator bool() {
return active; }
99 #ifdef MINIMP3_FLOAT_OUTPUT
113 samples = ::mp3dec_decode_frame(&
mp3d,
buffer.
data()+processed, open,
123 }
while(processed < write_len);
132 LOGD(
"provideResult: %d samples", samples);
147 if (
out !=
nullptr) {
148 #ifdef MINIMP3_FLOAT_OUTPUT
151 out->
write((uint8_t *)pcm16.
data(), samples *
sizeof(int16_t));
160 for(; i < num_samples; i++){
161 float sample = in[i] * 32768.0f;
162 if (sample >= 32766.5f)
163 out[i] = (int16_t) 32767;
164 else if (sample <= -32767.5f)
165 out[i] = (int16_t)-32768;
167 int16_t s = (int16_t)(sample + .5f);
#define TRACED()
Definition AudioLoggerIDF.h:31
#define LOGD(...)
Definition AudioLoggerIDF.h:27
#define MINIMP3_MAX_SAMPLE_RATE
Definition CodecMP3Mini.h:10
#define assert(T)
Definition avr.h:10
virtual size_t write(const uint8_t *data, size_t len)
Definition Arduino.h:120