2 #include "AudioConfig.h"
3 #include "maximilian.h"
4 #include "libs/maxiClock.h"
7 void play(maxi_float_t *channels);
8 void play1(maxi_float_t *channels);
9 void play2(maxi_float_t *channels);
20 Maximilian(
Print &out,
int bufferSize=DEFAULT_BUFFER_SIZE,
void (*callback)(maxi_float_t *channels)=play){
21 buffer_size = bufferSize;
23 this->callback = callback;
32 buffer.resize(buffer_size);
54 uint16_t samples = buffer_size /
sizeof(uint16_t);
55 int16_t *p_samples = (int16_t *) buffer.data();
56 for (uint16_t j=0;j<samples;j+=cfg.
channels){
60 p_samples[j+ch] =
volume() * out[ch] * 32767.0f;
64 unsigned int result = p_sink->write(buffer.data(), buffer_size);
65 LOGI(
"bytes written %u", result)
71 Print *p_sink=
nullptr;
73 void (*callback)(maxi_float_t *channels);