From 244007b0c53872ba29c6ad9475ba3ee9a62688b7 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Thu, 18 Jan 2018 10:53:03 -0800 Subject: [PATCH] Enable AAC-SBR on ESP-32, there's enough RAM AAC-SBR allows for lower bitrates to have higher quality audio output, and is used by many web radio stations. It was disables on the ESP8266 due to RAM limitations (about 50KB too little), but the ESP32 has no such problem. Enable it automatically during compile. --- README.md | 4 +++- src/libhelix-aac/aaccommon.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 54b3fd8..af7a1b8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,9 @@ ESP8266 is fully supported and most mature, but we've also just introduced suppo ## Disclaimer All this code is released under the GPL, and all of it is to be used at your own risk. If you find any bugs, please let me know via the GitHub issue tracker or drop me an email. The MOD and MP3 routines were taken from StellaPlayer and libMAD respectively. The software I2S delta-sigma 32x oversampling DAC was my own creation, and sounds quite good if I do say so myself. -The AAC decode code is from the Helix project and licensed under RealNetwork's RSPL license. For commercial use you're still going to need the usual AAC licensing from Via Licensing (http://www.via-corp.com/us/en/licensing/aac/overview.html). Please note that AAC streams with SBR are not supported (many webradio stations use this to reduce bandwidth even further). About 50KB additional RAM (above standard AAC needsz of ~25KB) is required, and there's simply not enough RAM on-chip to fit it. +The AAC decode code is from the Helix project and licensed under RealNetwork's RSPL license. For commercial use you're still going to need the usual AAC licensing from Via Licensing (http://www.via-corp.com/us/en/licensing/aac/overview.html). + +On the ESP32, AAC-SBR is supported (many webradio stations use this to reduce bandwidth even further). The ESP8266, however, does not support it due to a lack of onboard RAM. MIDI decoding comes from a highly ported MIDITONES (https://github.com/LenShustek/miditones) combined with a massively memory-optimized TinySoundFont (https://github.com/schellingb/TinySoundFont), see the respective source files for more information. diff --git a/src/libhelix-aac/aaccommon.h b/src/libhelix-aac/aaccommon.h index 4839c2f..242bb4b 100644 --- a/src/libhelix-aac/aaccommon.h +++ b/src/libhelix-aac/aaccommon.h @@ -50,7 +50,9 @@ #include // Can't fit in ESP8266 RAM -// #define AAC_ENABLE_SBR 1 +#ifdef ESP32 + #define AAC_ENABLE_SBR 1 +#endif #pragma GCC optimize ("O3")