This commit is contained in:
2026-02-12 21:00:02 -08:00
parent 77f8236347
commit 8bdbf227ca
1141 changed files with 1010880 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
#include "AudioTools.h"
#define SAMPLE_COUNT 2048
#define SAMPLE_BUFFER_SIZE sizeof(int32_t) * SAMPLE_COUNT
unsigned char raw_data[SAMPLE_BUFFER_SIZE];
AudioInfo info(8000, 1, 32);
I2SStream i2sStream; // Access I2S as stream
MemoryStream raw_samples(raw_data, SAMPLE_BUFFER_SIZE, true, RAM);
StreamCopy copier(raw_samples, i2sStream, 1024); // copies sound
void setup() {
Serial.begin(115200);
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info);
auto cfg = i2sStream.defaultConfig(RX_MODE);
cfg.copyFrom(info);
i2sStream.begin(cfg);
raw_samples.begin();
copier.copy();
assert(raw_samples.available()== 1024);
assert(raw_samples.availableForWrite()== 7168);
}
void loop() {
// put your main code here, to run repeatedly:
}