arduino-audio-tools
MemoryManager.h
1 #pragma once
2 
3 #include "AudioLogger.h"
4 #ifdef ESP32
5 #include "esp_heap_caps.h"
6 #endif
7 
8 namespace audio_tools {
9 
19 public:
21  MemoryManager() = default;
23  MemoryManager(int limit) {
24  begin(limit);
25  };
27  bool begin(int limit = 10000) {
28 #ifdef ESP32
29  LOGI("Activate PSRAM from %d bytes", limit);
30  heap_caps_malloc_extmem_enable(limit);
31  return true;
32 #else
33  return false;
34 #endif
35  }
36 };
37 
38 }
MemoryManager which activates the use of external SPIRAM memory. When external memory is in use,...
Definition: MemoryManager.h:18
MemoryManager()=default
Default Constructor - call begin() to activate PSRAM.
MemoryManager(int limit)
Constructor which activates PSRAM. This constructor automatically calls begin()
Definition: MemoryManager.h:23
bool begin(int limit=10000)
Activate the PSRAM for allocated memory > limit.
Definition: MemoryManager.h:27
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition: AudioConfig.h:823