Skip to content

[Bug] Voice capture UI freeze & Linux compatibility issues (ffmpeg process & Bun.file dependency) #234

Description

@dhdjdjdhdjddj904-eng

Description

When using the voice capture feature (Ctrl + V), two main issues occur:

  1. UI Refresh Bug: After speaking, the transcribed text is added to stdinInput, but renderInput() is not called and activeFooter status is not cleared. This leaves the "Recording..." popup visible and hides the transcribed text until extra keypresses force a UI re-render.
  2. Linux/Node Process Management: On Linux/Node runtime, ffmpeg doesn't exit cleanly with SIGKILL/SIGTERM during voice capture, leading to empty/corrupted audio files or hanging processes. Switching to SIGINT allows ffmpeg to finalize the WAV header properly.

Steps to Reproduce

  1. Press Ctrl + V to start recording.
  2. Speak a phrase and press Ctrl + V (or Enter) to stop.
  3. Observe that the footer status message remains stuck on "Recording..." and the text does not appear in the input prompt immediately.

Suggested Fixes / Code Context

In startVoiceCapture() / input event handler:

  • UI Reset & Render: Ensure activeFooter.setStatusMessage("") is called in the finally block or on success, followed by renderInput() after setting stdinInput so the transcribed text is displayed right away.
  • Process Termination: Send SIGINT instead of SIGTERM/SIGKILL to the ffmpeg spawned process so it cleanly stops recording and flushes the WAV file headers before transcription.
  • Platform Agnostic Audio: Fallback gracefully when avfoundation or Bun.file are not available in non-macOS or non-Bun environments.

Environment

  • OS: Linux (CachyOS / Arch)
  • Audio Subsystem: PipeWire / PulseAudio

Opened on behalf of @YounessTaki0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions