refactor ♻️: Updated I2S sample rate from 8 kHz to 4 kHz, reduced DMA buffer count and length, adjusted gain for 16-bit range, increased task stack size and priority, and decreased debug interval

- Updated `AudioLevelTracker.h` to scale the maximum range limit by a factor of 16.
- Updated the I2S sample rate from 8 kHz to 4 kHz, reduced DMA buffer count and length, adjusted gain for 16-bit range, increased task stack size and priority, and decreased debug interval.
- The `initI2S` function has been modified to use a smaller buffer size and adjust the data format to 16-bit, ensuring compatibility with existing code while reducing memory usage.
This commit is contained in:
2025-04-25 10:47:52 +02:00
parent 178bfc630a
commit 7331d2fe01
3 changed files with 25 additions and 17 deletions

View File

@@ -2,6 +2,7 @@
#include <Arduino.h>
#include <deque>
#include "Config.h"
class AudioLevelTracker {
public:
@@ -19,5 +20,5 @@ private:
int32_t maxLevel;
static const uint32_t HISTORY_DURATION_MS = 3000; // 3 seconds history
static const int32_t MAX_RANGE_LIMIT = 200000000; // Maximum allowed range limit
static const int32_t MAX_RANGE_LIMIT = Config::DEFAULT_RANGE_LIMIT << 16; // Scale up 16-bit limit
};