9#define AUDIOTOOLS_VERSION "1.1.3"
10#define AUDIOTOOLS_MAJOR_VERSION 1
11#define AUDIOTOOLS_MINOR_VERSION 1
14#include "AudioTools/PlatformConfig/desktop.h"
17#include "AudioTools/CoreAudio/AudioRuntime.h"
20#if __has_include("AudioConfigLocal.h")
21#include "AudioConfigLocal.h"
25#ifndef AUDIO_INCLUDE_CORE
26# define AUDIO_INCLUDE_CORE true
30#ifndef PREFER_FIXEDPOINT
31# define PREFER_FIXEDPOINT false
35#ifndef USE_AUDIOTOOLS_NS
36# define USE_AUDIOTOOLS_NS true
47#ifndef USE_AUDIO_LOGGING
48# define USE_AUDIO_LOGGING true
52# define LOG_LEVEL AudioLogger::Warning
56# define LOG_STREAM Serial
59#ifndef LOG_PRINTF_BUFFER_SIZE
60# define LOG_PRINTF_BUFFER_SIZE 303
64# define LOG_METHOD __PRETTY_FUNCTION__
68#ifndef USE_CHECK_MEMORY
69# define USE_CHECK_MEMORY false
74# define USE_OBSOLETE false
81#ifndef DEFAULT_BUFFER_SIZE
82# define DEFAULT_BUFFER_SIZE 1024
85#ifndef DEFAULT_SAMPLE_RATE
86# define DEFAULT_SAMPLE_RATE 44100
89#ifndef DEFAULT_CHANNELS
90# define DEFAULT_CHANNELS 2
93#ifndef DEFAULT_BITS_PER_SAMPLE
94# define DEFAULT_BITS_PER_SAMPLE 16
97#ifndef I2S_DEFAULT_PORT
98# define I2S_DEFAULT_PORT 0
101#ifndef I2S_BUFFER_SIZE
102# define I2S_BUFFER_SIZE 512
105#ifndef I2S_BUFFER_COUNT
106# define I2S_BUFFER_COUNT 6
109#ifndef ANALOG_BUFFER_SIZE
110# define ANALOG_BUFFER_SIZE 512
113#ifndef ANALOG_BUFFER_COUNT
114# define ANALOG_BUFFER_COUNT 6
117#ifndef A2DP_BUFFER_SIZE
118# define A2DP_BUFFER_SIZE 512
121#ifndef A2DP_BUFFER_COUNT
122# define A2DP_BUFFER_COUNT 30
125#ifndef CODEC_DELAY_MS
126# define CODEC_DELAY_MS 10
129#ifndef COPY_DELAY_ON_NODATA
130# define COPY_DELAY_ON_NODATA 10
133#ifndef COPY_RETRY_LIMIT
134# define COPY_RETRY_LIMIT 20
137#ifndef MAX_SINGLE_CHARS
138# define MAX_SINGLE_CHARS 8
143# define HTTP_MAX_LEN 1024
147#ifndef HTTP_CHUNKED_SIZE_MAX_LEN
148# define HTTP_CHUNKED_SIZE_MAX_LEN 80
152#ifndef USE_RESAMPLE_BUFFER
153# define USE_RESAMPLE_BUFFER true
159#ifndef PWM_BUFFER_SIZE
160# define PWM_BUFFER_SIZE 1024
163#ifndef PWM_BUFFER_COUNT
164# define PWM_BUFFER_COUNT 4
167#ifndef PWM_AUDIO_FREQUENCY
168# define PWM_AUDIO_FREQUENCY 30000
182 # include "AudioTools/PlatformConfig/esp32.h"
187# include "AudioTools/PlatformConfig/esp8266.h"
191#if (defined(ARDUINO_SEEED_XIAO_NRF52840_SENSE) || defined(ARDUINO_ARDUINO_NANO33BLE) ) && !defined(ARDUINO_ARCH_ZEPHYR)
192# include "AudioTools/PlatformConfig/nrf52840.h"
196#if defined(ARDUINO_ARCH_MBED_RP2040)
198# include "AudioTools/PlatformConfig/rp2040mbed.h"
202#if defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_MBED)
203# include "AudioTools/PlatformConfig/rp2040hower.h"
208# include "AudioTools/PlatformConfig/avr.h"
212#if defined(ARDUINO_ARCH_STM32) || defined(STM32)
213# include "AudioTools/PlatformConfig/stm32.h"
217#ifdef ARDUINO_ARCH_SAMD
218# include "AudioTools/PlatformConfig/samd.h"
223#if defined(ARDUINO_GIGA)
224# include "AudioTools/PlatformConfig/giga.h"
229#if defined(ARDUINO_ARCH_MBED_PORTENTA)
230# include "AudioTools/PlatformConfig/portenta.h"
235#if defined(ARDUINO_ARCH_RENESAS) || defined(_RENESAS_RA_)
236# include "AudioTools/PlatformConfig/unor4.h"
240#ifdef ARDUINO_ARCH_ZEPHYR
246#ifndef VS1053_DEFINED
248# define VS1053_DCS 16
249# define VS1053_DREQ 4
250# define VS1053_RESET 15
251# define VS1053_CS_SD -1
257#define VS1053_DEFAULT_VOLUME 0.7
264# define USE_STREAM_WRITE_OVERRIDE
267#ifndef ANALOG_MAX_SAMPLE_RATE
268# define ANALOG_MAX_SAMPLE_RATE 44100
271#ifndef PWM_MAX_SAMPLE_RATE
272# define PWM_MAX_SAMPLE_RATE 8000
275#ifndef URL_CLIENT_TIMEOUT
276# define URL_CLIENT_TIMEOUT 60000;
277# define URL_HANDSHAKE_TIMEOUT 120000
281# define USE_TASK false
284#ifndef USE_SERVER_ACCEPT
285# define USE_SERVER_ACCEPT false
289# define USE_ALLOCATOR false
292#ifndef USE_ESP32_LOGGER
293# define USE_ESP32_LOGGER false
297#ifndef USE_PRINT_FLUSH
298# define USE_PRINT_FLUSH true
301#ifndef ESP_IDF_VERSION_VAL
302# define ESP_IDF_VERSION_VAL(a, b , c) 0
306# define CHECK_MEMORY() checkMemory(true)
308# define CHECK_MEMORY()
311#pragma GCC diagnostic ignored "-Wunused-variable"
312#pragma GCC diagnostic ignored "-Wunused-function"
313#pragma GCC diagnostic ignored "-Wvla"
314#pragma GCC diagnostic ignored "-Wsign-compare"
315#pragma GCC diagnostic ignored "-Woverloaded-virtual"
316#pragma GCC diagnostic ignored "-Wdouble-promotion"
318#ifdef USE_NO_MEMACCESS
319#pragma GCC diagnostic ignored "-Wclass-memaccess"
322#ifdef USE_INITIALIZER_LIST
323#pragma GCC diagnostic ignored "-Wnarrowing"
329#include "AudioTools/CoreAudio/AudioBasic/Int24_3bytes_t.h"
330#include "AudioTools/CoreAudio/AudioBasic/Int24_4bytes_t.h"
331#include "AudioTools/CoreAudio/AudioBasic/FloatAudio.h"
334 #ifdef USE_3BYTE_INT24