From e46376a2d9263ba9c8ef26891de44bd5920bd4a9 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 1 Jul 2026 13:45:19 -0400 Subject: fix(recording): record audio-only to lossless FLAC, not AAC/M4A Audio-only recordings were written as AAC in an MP4/.m4a container. The stop path SIGINTs ffmpeg, and if the MP4 muxer doesn't write its moov trailer before exit, the file has no moov atom and won't decode. ffmpeg and AssemblyAI both reject it. Three recordings were lost that way and had to be rebuilt with untrunc. The video path already avoids this by using Matroska, which needs no finalize pass. I switched the audio-only path to FLAC. FLAC frames are self-contained, so an abruptly stopped recording still decodes, with no trailer to miss at close. It's also lossless, dropping the 64k AAC encode that degraded speech before transcription. AssemblyAI recommends a lossless source and accepts FLAC directly. The transcription path passes audio files through untouched. --- tests/test-video-audio-recording-command-structure.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/test-video-audio-recording-command-structure.el') diff --git a/tests/test-video-audio-recording-command-structure.el b/tests/test-video-audio-recording-command-structure.el index f4c24c39..41bd3b6a 100644 --- a/tests/test-video-audio-recording-command-structure.el +++ b/tests/test-video-audio-recording-command-structure.el @@ -260,8 +260,8 @@ (should (string-match-p "-f pulse" command)))) (test-command-structure-teardown))) -(ert-deftest test-audio-recording-command-outputs-m4a () - "Test that audio recording outputs to .m4a file." +(ert-deftest test-audio-recording-command-outputs-flac () + "Test that audio recording outputs to .flac file." (test-command-structure-setup) (unwind-protect (let ((command nil)) @@ -272,7 +272,7 @@ ((symbol-function 'cj/recording--validate-system-audio) (lambda () nil))) (cj/ffmpeg-record-audio audio-recordings-dir) - (should (string-match-p "\\.m4a" command)))) + (should (string-match-p "\\.flac" command)))) (test-command-structure-teardown))) ;;; Common Command Structure (Both Video and Audio) -- cgit v1.2.3