diff options
| author | Craig Jennings <c@cjennings.net> | 2026-02-26 17:08:19 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-02-26 17:08:19 -0600 |
| commit | 58ef63abd5a9187ee93609f142cb21a933da16c5 (patch) | |
| tree | 048052e931d218cac1930d736739e11e491b4e7b /tests/test-video-audio-recording-ffmpeg-functions.el | |
| parent | f473f610b7fccffd3d10d8e81342218cd4ab25fc (diff) | |
feat(recording): validate system audio device before recording
Add pre-recording validation that catches stale or drifted system audio
devices before they cause silent recordings. When the default audio
output changes (Bluetooth reconnect, device switch) between setup and
recording, the monitor device is auto-updated. Warns if no audio is
currently playing through the monitored sink.
Co-Authored-By: Craig Jennings <c@cjennings.net>
Diffstat (limited to 'tests/test-video-audio-recording-ffmpeg-functions.el')
| -rw-r--r-- | tests/test-video-audio-recording-ffmpeg-functions.el | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/tests/test-video-audio-recording-ffmpeg-functions.el b/tests/test-video-audio-recording-ffmpeg-functions.el index a3bac0cf..549aa317 100644 --- a/tests/test-video-audio-recording-ffmpeg-functions.el +++ b/tests/test-video-audio-recording-ffmpeg-functions.el @@ -52,7 +52,9 @@ (cl-letf (((symbol-function 'start-process-shell-command) (lambda (_name _buffer _command) (setq process-created t) - (make-process :name "fake-video" :command '("sleep" "1000"))))) + (make-process :name "fake-video" :command '("sleep" "1000")))) + ((symbol-function 'cj/recording--validate-system-audio) + (lambda () nil))) (cj/ffmpeg-record-video video-recordings-dir) (should process-created) (should cj/video-recording-ffmpeg-process))) @@ -69,7 +71,9 @@ ((symbol-function 'set-process-sentinel) (lambda (_proc sentinel) (should (eq sentinel #'cj/recording-process-sentinel)) - (setq sentinel-attached t)))) + (setq sentinel-attached t))) + ((symbol-function 'cj/recording--validate-system-audio) + (lambda () nil))) (cj/ffmpeg-record-video video-recordings-dir) (should sentinel-attached))) (test-ffmpeg-teardown))) @@ -83,7 +87,9 @@ (lambda (_name _buffer _command) (make-process :name "fake-video" :command '("sleep" "1000")))) ((symbol-function 'force-mode-line-update) - (lambda (&optional _all) (setq update-called t)))) + (lambda (&optional _all) (setq update-called t))) + ((symbol-function 'cj/recording--validate-system-audio) + (lambda () nil))) (cj/ffmpeg-record-video video-recordings-dir) (should update-called))) (test-ffmpeg-teardown))) @@ -96,7 +102,9 @@ (cl-letf (((symbol-function 'start-process-shell-command) (lambda (_name _buffer cmd) (setq command cmd) - (make-process :name "fake-video" :command '("sleep" "1000"))))) + (make-process :name "fake-video" :command '("sleep" "1000")))) + ((symbol-function 'cj/recording--validate-system-audio) + (lambda () nil))) (cj/ffmpeg-record-video video-recordings-dir) (should (string-match-p "test-mic-device" command)) (should (string-match-p "test-monitor-device" command)) @@ -114,7 +122,9 @@ (cl-letf (((symbol-function 'start-process-shell-command) (lambda (_name _buffer _command) (setq process-created t) - (make-process :name "fake-audio" :command '("sleep" "1000"))))) + (make-process :name "fake-audio" :command '("sleep" "1000")))) + ((symbol-function 'cj/recording--validate-system-audio) + (lambda () nil))) (cj/ffmpeg-record-audio audio-recordings-dir) (should process-created) (should cj/audio-recording-ffmpeg-process))) @@ -131,7 +141,9 @@ ((symbol-function 'set-process-sentinel) (lambda (_proc sentinel) (should (eq sentinel #'cj/recording-process-sentinel)) - (setq sentinel-attached t)))) + (setq sentinel-attached t))) + ((symbol-function 'cj/recording--validate-system-audio) + (lambda () nil))) (cj/ffmpeg-record-audio audio-recordings-dir) (should sentinel-attached))) (test-ffmpeg-teardown))) @@ -145,7 +157,9 @@ (lambda (_name _buffer _command) (make-process :name "fake-audio" :command '("sleep" "1000")))) ((symbol-function 'force-mode-line-update) - (lambda (&optional _all) (setq update-called t)))) + (lambda (&optional _all) (setq update-called t))) + ((symbol-function 'cj/recording--validate-system-audio) + (lambda () nil))) (cj/ffmpeg-record-audio audio-recordings-dir) (should update-called))) (test-ffmpeg-teardown))) @@ -158,7 +172,9 @@ (cl-letf (((symbol-function 'start-process-shell-command) (lambda (_name _buffer cmd) (setq command cmd) - (make-process :name "fake-audio" :command '("sleep" "1000"))))) + (make-process :name "fake-audio" :command '("sleep" "1000")))) + ((symbol-function 'cj/recording--validate-system-audio) + (lambda () nil))) (cj/ffmpeg-record-audio audio-recordings-dir) (should (string-match-p "\\.m4a" command)))) (test-ffmpeg-teardown))) |
