Record 16 kHz mono PCM to microSD /rec, with level meter and DAC2 playback. Co-authored-by: Cursor <cursoragent@cursor.com>
18 lines
546 B
C
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 */
|