// SPDX-License-Identifier: GPL-3.0-only // Recording session state machine: pumps mic audio into a WAV file on the SD card and // writes sidecar JSON metadata when a session ends. #pragma once #include namespace recorder { enum class State { Idle, Recording }; // Bring up audio + storage. Returns false if either fails (caller shows an error state). bool begin(); // Call frequently from loop(): when recording, drains the mic into the file. void update(); bool startRecording(); bool stopRecording(); bool toggle(); // start if idle, stop if recording State state(); const String ¤tId(); // id of the in-progress/last recording uint32_t recordedBytes(); // PCM bytes written in the current session } // namespace recorder