arduino-audio-tools
Loading...
Searching...
No Matches
MemoryManager.h
Go to the documentation of this file.
1#pragma once
2
3#include "AudioLogger.h"
4#ifdef ESP32
5#include "esp_heap_caps.h"
6#endif
7
8namespace audio_tools {
9
21public:
23 MemoryManager() = default;
25 MemoryManager(int limit) {
26 begin(limit);
27 };
29 bool begin(int limit = 10000) {
30#ifdef ESP32
31 LOGI("Activate PSRAM from %d bytes", limit);
33 return true;
34#else
35 return false;
36#endif
37 }
38};
39
40}
#define LOGI(...)
Definition AudioLoggerIDF.h:28
MemoryManager which activates the use of external SPIRAM memory. When external memory is in use,...
Definition MemoryManager.h:20
MemoryManager()=default
Default Constructor - call begin() to activate PSRAM.
MemoryManager(int limit)
Constructor which activates PSRAM. This constructor automatically calls begin()
Definition MemoryManager.h:25
bool begin(int limit=10000)
Activate the PSRAM for allocated memory > limit.
Definition MemoryManager.h:29
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition AudioCodecsBase.h:10
size_t writeData(Print *p_out, T *data, int samples, int maxSamples=512)
Definition AudioTypes.h:508