#pragma once #include #include #include "Config.h" class AudioLevelTracker { public: AudioLevelTracker(); void updateMaxLevel(int16_t sample); // Changed to int16_t int16_t getMaxLevel() const; // Changed to int16_t void resetMaxLevel(); private: struct SamplePoint { uint32_t timestamp; int16_t value; // Changed to int16_t }; std::deque sampleHistory; int16_t maxLevel; // Changed to int16_t static const uint32_t HISTORY_DURATION_MS = 3000; // 3 seconds history static const int16_t MAX_RANGE_LIMIT = Config::DEFAULT_RANGE_LIMIT; // Use 16-bit limit directly };