Files
inmp441recondtest/include/recorder.h
DESKTOP-PUHFO60\dsx2016 ddff48d05b 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>
2026-10-27 21:16:13 +08:00

18 lines
546 B
C

#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 */