🐛 [BUG]: Surface ffmpeg startup failures instead of reporting playback #67

Closed
opened 2026-06-22 09:33:10 +00:00 by FrauJulian · 0 comments
FrauJulian commented 2026-06-22 09:33:10 +00:00 (Migrated from github.com)

Description

startFfmpeg() currently registers an error listener that ignores the error, and AudioManager.play() sets the manager to playing immediately after creating the Discord audio resource.

Evidence:

  • src/ffmpeg.ts:52 spawns the process
  • src/ffmpeg.ts:54 swallows the child process error event
  • src/ffmpeg.ts:55 drains stderr without preserving diagnostics
  • src/audio-manager.ts:121 sets playbackState = 'playing'

Impact: when ffmpeg is missing, cannot execute, or fails before producing audio, callers can see a successful play() call and state === 'playing' while no audio is actually playable. The exported FfmpegProcessError is not used for this path.

Acceptance Criteria

  • ffmpeg startup errors are observable by callers instead of being swallowed.
  • AudioManager.play() does not leave the manager in playing when startup fails.
  • Include useful failure context, ideally using the existing FfmpegProcessError export.
  • Preserve a small stderr tail or equivalent diagnostic when ffmpeg exits early.
  • Add a focused test for a mocked child-process error event or early exit before playback is accepted.
## Description `startFfmpeg()` currently registers an `error` listener that ignores the error, and `AudioManager.play()` sets the manager to `playing` immediately after creating the Discord audio resource. Evidence: - `src/ffmpeg.ts:52` spawns the process - `src/ffmpeg.ts:54` swallows the child process `error` event - `src/ffmpeg.ts:55` drains stderr without preserving diagnostics - `src/audio-manager.ts:121` sets `playbackState = 'playing'` Impact: when `ffmpeg` is missing, cannot execute, or fails before producing audio, callers can see a successful `play()` call and `state === 'playing'` while no audio is actually playable. The exported `FfmpegProcessError` is not used for this path. ## Acceptance Criteria - `ffmpeg` startup errors are observable by callers instead of being swallowed. - `AudioManager.play()` does not leave the manager in `playing` when startup fails. - Include useful failure context, ideally using the existing `FfmpegProcessError` export. - Preserve a small stderr tail or equivalent diagnostic when ffmpeg exits early. - Add a focused test for a mocked child-process `error` event or early exit before playback is accepted.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: fraujulian/Discord-Audio-Stream#67