10#pragma GCC diagnostic ignored "-Wunused-variable"
11#pragma GCC diagnostic ignored "-Wunused-function"
12#pragma GCC diagnostic ignored "-Wvla"
13#pragma GCC diagnostic ignored "-Wsign-compare"
14#pragma GCC diagnostic ignored "-Woverloaded-virtual"
15#pragma GCC diagnostic ignored "-Wdouble-promotion"
17#define AUDIOTOOLS_VERSION "1.2.4"
18#define AUDIOTOOLS_MAJOR_VERSION 1
19#define AUDIOTOOLS_MINOR_VERSION 2
30#if __has_include("AudioConfigLocal.h")
31#include "AudioConfigLocal.h"
35#ifndef AUDIO_INCLUDE_CORE
36# define AUDIO_INCLUDE_CORE true
40#ifndef PREFER_FIXEDPOINT
41# define PREFER_FIXEDPOINT false
45#ifndef USE_AUDIOTOOLS_NS
46# define USE_AUDIOTOOLS_NS true
57#ifndef USE_AUDIO_LOGGING
58# define USE_AUDIO_LOGGING true
62# define LOG_LEVEL AudioLogger::Warning
66# define LOG_STREAM Serial
69#ifndef LOG_PRINTF_BUFFER_SIZE
70# define LOG_PRINTF_BUFFER_SIZE 303
74# define LOG_METHOD __PRETTY_FUNCTION__
78#ifndef USE_CHECK_MEMORY
79# define USE_CHECK_MEMORY false
84# define USE_OBSOLETE false
91#ifndef DEFAULT_BUFFER_SIZE
92# define DEFAULT_BUFFER_SIZE 1024
95#ifndef DEFAULT_SAMPLE_RATE
96# define DEFAULT_SAMPLE_RATE 44100
99#ifndef DEFAULT_CHANNELS
100# define DEFAULT_CHANNELS 2
103#ifndef DEFAULT_BITS_PER_SAMPLE
104# define DEFAULT_BITS_PER_SAMPLE 16
107#ifndef I2S_DEFAULT_PORT
108# define I2S_DEFAULT_PORT 0
111#ifndef I2S_BUFFER_SIZE
112# define I2S_BUFFER_SIZE 512
115#ifndef I2S_BUFFER_COUNT
116# define I2S_BUFFER_COUNT 6
119#ifndef ANALOG_BUFFER_SIZE
120# define ANALOG_BUFFER_SIZE 512
123#ifndef ANALOG_BUFFER_COUNT
124# define ANALOG_BUFFER_COUNT 6
127#ifndef A2DP_BUFFER_SIZE
128# define A2DP_BUFFER_SIZE 512
131#ifndef A2DP_BUFFER_COUNT
132# define A2DP_BUFFER_COUNT 30
135#ifndef CODEC_DELAY_MS
136# define CODEC_DELAY_MS 10
139#ifndef COPY_DELAY_ON_NODATA
140# define COPY_DELAY_ON_NODATA 10
143#ifndef COPY_RETRY_LIMIT
144# define COPY_RETRY_LIMIT 20
147#ifndef MAX_SINGLE_CHARS
148# define MAX_SINGLE_CHARS 8
153# define HTTP_MAX_LEN 1024
157#ifndef HTTP_CHUNKED_SIZE_MAX_LEN
158# define HTTP_CHUNKED_SIZE_MAX_LEN 80
162#ifndef USE_RESAMPLE_BUFFER
163# define USE_RESAMPLE_BUFFER true
169#ifndef PWM_BUFFER_SIZE
170# define PWM_BUFFER_SIZE 1024
173#ifndef PWM_BUFFER_COUNT
174# define PWM_BUFFER_COUNT 4
177#ifndef PWM_AUDIO_FREQUENCY
178# define PWM_AUDIO_FREQUENCY 30000
182#ifndef AUDIOTOOLS_METADATA_ICY_ASCII_ONLY
183#define AUDIOTOOLS_METADATA_ICY_ASCII_ONLY true
186#ifndef AUDIOTOOLS_METADATA_ICY_LIMIT
187#define AUDIOTOOLS_METADATA_ICY_LIMIT 400
215#if (defined(ARDUINO_SEEED_XIAO_NRF52840_SENSE) || defined(ARDUINO_ARDUINO_NANO33BLE) ) && !defined(ARDUINO_ARCH_ZEPHYR)
220#if defined(ARDUINO_ARCH_MBED_RP2040)
226#if defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_MBED)
236#if defined(ARDUINO_ARCH_STM32) || defined(STM32)
241#ifdef ARDUINO_ARCH_SAMD
247#if defined(ARDUINO_GIGA)
253#if defined(ARDUINO_ARCH_MBED_PORTENTA)
259#if defined(ARDUINO_ARCH_RENESAS) || defined(_RENESAS_RA_)
265#include <zephyr/kernel.h>
266#include <zephyr/sys/util.h>
273#ifndef VS1053_DEFINED
275# define VS1053_DCS 16
276# define VS1053_DREQ 4
277# define VS1053_RESET 15
278# define VS1053_CS_SD -1
284#define VS1053_DEFAULT_VOLUME 0.7
291# define USE_STREAM_WRITE_OVERRIDE
294#ifndef ANALOG_MAX_SAMPLE_RATE
295# define ANALOG_MAX_SAMPLE_RATE 44100
298#ifndef PWM_MAX_SAMPLE_RATE
299# define PWM_MAX_SAMPLE_RATE 8000
302#ifndef URL_CLIENT_TIMEOUT
303# define URL_CLIENT_TIMEOUT 60000;
306#ifndef URL_HANDSHAKE_TIMEOUT
307# define URL_HANDSHAKE_TIMEOUT 120000
311# define USE_TASK false
314#ifndef USE_SERVER_ACCEPT
315# define USE_SERVER_ACCEPT false
319# define USE_ALLOCATOR false
322#ifndef USE_ESP32_LOGGER
323# define USE_ESP32_LOGGER false
327#ifndef USE_PRINT_FLUSH
328# define USE_PRINT_FLUSH true
331#ifndef ESP_IDF_VERSION_VAL
332# define ESP_IDF_VERSION_VAL(a, b , c) 0
335#ifdef USE_NO_MEMACCESS
336#pragma GCC diagnostic ignored "-Wclass-memaccess"
339#ifdef USE_INITIALIZER_LIST
340#pragma GCC diagnostic ignored "-Wnarrowing"
344# define CHECK_MEMORY() checkMemory(true)
346# define CHECK_MEMORY()
If you want to use the framework w/o Arduino you need to provide the implementation of a couple of cl...