Skip to content

Commit 496a9f2

Browse files
committed
2 parents 778a25e + 1b13443 commit 496a9f2

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Some basic __header-only C++ classes__ that can be used for __Audio Processing__
88
- Helps to [communicate](https://github.com/pschatzmann/arduino-audio-tools/wiki/Communication) audio over the wire or wirelessly
99
- Different [Sound Generators](https://pschatzmann.github.io/arduino-audio-tools/group__generator.html) (e.g. to generate a sine tone) for [GeneratedSoundStream](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_generated_sound_stream.html)
1010
- Support for [Sound Effects](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_audio_effect_stream.html) with different [Effect Implementations](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_audio_effect.html) (e.g. Boost, Distortion, Echo, Reverb...) for [AudioEffectStream](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_audio_effect_stream_t.html)
11+
- Provides a [3 Band Equilizer](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_equilizer3_bands.html)
1112
- Different [Converters](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_base_converter.html) for [ConverterStream](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_converter_stream.html)
1213
- Different [Filters](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_filter.html) for [FilteredStream](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_filtered_stream.html)
1314
- [Musical Notes](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_musical_notes.html) (with frequencies of notes)

src/AudioConfig.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ typedef WiFiClient WiFiClientSecure;
263263
# define USE_PRINT_FLUSH false
264264
# endif
265265
# define USE_SD_SUPPORTS_SPI
266+
//# define USE_ESP32_LOGGER true
266267
#endif
267268

268269
// ----- Regular ESP32 -----
@@ -340,12 +341,13 @@ typedef uint32_t eps32_i2s_sample_rate_type;
340341
//-------ESP32C3, ESP32S3, ESP32S2---------
341342

342343
#if defined(ESP32) && defined(ESP32X)
343-
#include "esp32-hal-log.h"
344-
#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 0 , 0)
344+
# ifdef ARDUINO
345+
# include "esp32-hal-log.h"
346+
# endif
347+
# if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 0 , 0)
345348
# define USE_INT24_FROM_INT
346349
# define USE_ANALOG
347-
#endif
348-
350+
# endif
349351

350352
#define USE_PWM
351353
#define USE_URL_ARDUINO
@@ -831,6 +833,9 @@ using WiFiServerSecure = BearSSL::WiFiServerSecure;
831833
# define USE_ALLOCATOR false
832834
#endif
833835

836+
#ifndef USE_ESP32_LOGGER
837+
# define USE_ESP32_LOGGER false
838+
#endif
834839

835840
// Standard Arduino Print provides flush function
836841
#ifndef USE_PRINT_FLUSH

src/AudioTools/CoreAudio/AudioLogger.h

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@
1010
#include "AudioTools/Concurrency/RP2040/MutexRP2040.h"
1111
#elif defined(ESP32)
1212
#include "AudioTools/Concurrency/RTOS/MutexRTOS.h"
13+
#include "esp_log.h"
1314
#endif
1415

1516
// Logging Implementation
17+
#if defined(ESP32)
18+
#endif
19+
1620
#if USE_AUDIO_LOGGING
1721

1822
namespace audio_tools {
@@ -211,6 +215,14 @@ class CustomLogLevel {
211215
if (AudioLogger::instance().level() <= AudioLogger::Error) { \
212216
LOG_MIN(AudioLogger::Error); \
213217
}
218+
#elif USE_ESP32_LOGGER
219+
220+
#define TAG_AUDIO "AUDIO"
221+
#define LOGD(...) ESP_LOGD(TAG_AUDIO,__VA_ARGS__);
222+
#define LOGI(...) ESP_LOGI(TAG_AUDIO,__VA_ARGS__);
223+
#define LOGW(...) ESP_LOGW(TAG_AUDIO,__VA_ARGS__);
224+
#define LOGE(...) ESP_LOGE(TAG_AUDIO,__VA_ARGS__);
225+
214226
#else
215227
// Log statments which store the fmt string in Progmem
216228
#define LOGD(fmt, ...) \
@@ -271,10 +283,10 @@ class CustomLogLevel {
271283
#else
272284

273285
// Switch off logging
274-
#define LOGD(...)
275-
#define LOGI(...)
276-
#define LOGW(...)
277-
#define LOGE(...)
286+
#define LOGD(...)
287+
#define LOGI(...)
288+
#define LOGW(...)
289+
#define LOGE(...)
278290
#define TRACED()
279291
#define TRACEI()
280292
#define TRACEW()

src/AudioTools/CoreAudio/AudioMetaData/MetaDataFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class MetaDataFilter : public AudioOutput {
8080
size_t written = 0;
8181
if (p_out) written = p_out->write(tmp.data(), to_write);
8282
if (p_writer) written = p_writer->write(tmp.data(), to_write);
83-
assert(to_write == to_write);
83+
assert(to_write == written);
8484
metadata_range.clear();
8585
} else {
8686
LOGI("output ignored");

0 commit comments

Comments
 (0)