Add INMP441 WAV recorder for CYD 2.8/3.5.

Record 16 kHz mono PCM to microSD /rec, with level meter and DAC2 playback.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-27 21:16:13 +08:00
commit ddff48d05b
33 changed files with 1975 additions and 0 deletions

17
include/recorder.h Normal file
View File

@@ -0,0 +1,17 @@
#pragma once
#include <stdint.h>
#define REC_SAMPLE_RATE 16000
#define REC_MAX_SECONDS 120
bool recorder_mic_init(void);
bool recorder_start(void);
void recorder_stop(void);
bool recorder_is_active(void);
float recorder_level_db(void); /* smoothed approx dBFS+offset, or NAN */
uint32_t recorder_elapsed_ms(void);
uint32_t recorder_bytes_written(void);
const char *recorder_last_path(void); /* e.g. /rec/R0003.WAV */
const char *recorder_status(void);
void recorder_tick(void); /* call from loop; drains I2S → SD */