Skip to main content

Module recording

Module recording 

Source
Expand description

Recording session management — async input event handlers for the recording state machine.

These functions are called from the main event loop in super when keyboard or hotkey input events arrive. They implement the full recording pipeline: cpal capture → Whisper transcription → OpenCode injection.

§Push-to-talk flow

  1. [handle_push_to_talk_start] — opens a CpalRecorder, starts the audio stream, spawns an energy-forwarding task, transitions to RecordingState::Recording.
  2. [handle_push_to_talk_stop] — stops the recorder, checks minimum duration, writes a TempWav, transcribes via Whisper, injects into OpenCode, transitions back to Idle (or ApprovalPending).