diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-25 14:03:17 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-25 14:03:17 -0400 |
| commit | 3d9a650d9726c0d6091ff4d9fc7d98eba4819587 (patch) | |
| tree | 0f7226b709c860933cb50a0fe7c0fbd7712e3881 /modules | |
| parent | 7d509c34d802fd2e5d2018e2cb2bbe27e63abbed (diff) | |
| download | dotemacs-3d9a650d9726c0d6091ff4d9fc7d98eba4819587.tar.gz dotemacs-3d9a650d9726c0d6091ff4d9fc7d98eba4819587.zip | |
fix(transcription): land video transcripts beside the source, not in /tmp
The video flow extracts audio to a temp .mp3 in /tmp, then derived the .txt/.log from that temp path, so transcripts landed in /tmp and died on reboot, contradicting the "alongside the source" docstring. Thread the source video through cj/--start-transcription-process as an optional output base so the outputs derive from it (talk.mp4 -> talk.txt beside the video). Audio is unchanged. New regression test pins the output base to the source video.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/transcription-config.el | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/transcription-config.el b/modules/transcription-config.el index 566cea499..e00306d1e 100644 --- a/modules/transcription-config.el +++ b/modules/transcription-config.el @@ -173,13 +173,17 @@ TITLE and MESSAGE are strings. URGENCY is normal or critical." :body message :urgency (or urgency 'normal)))) -(defun cj/--start-transcription-process (audio-file &optional cleanup-file) +(defun cj/--start-transcription-process (audio-file &optional cleanup-file output-base) "Start async transcription process for AUDIO-FILE. Returns the process object. When CLEANUP-FILE is non-nil, delete that path once the transcription sentinel fires (success or failure). Used by the video flow to drop -the temp audio file produced by ffmpeg after transcription completes." +the temp audio file produced by ffmpeg after transcription completes. + +OUTPUT-BASE, when non-nil, is the path the .txt/.log outputs derive from +instead of AUDIO-FILE. The video flow passes the original video so the +transcript lands alongside the source, not next to the temp /tmp audio." (unless (file-exists-p audio-file) (user-error "Audio file does not exist: %s" audio-file)) @@ -187,7 +191,7 @@ the temp audio file produced by ffmpeg after transcription completes." (user-error "Not an audio file: %s" audio-file)) (let* ((script (cj/--transcription-script-path)) - (outputs (cj/--transcription-output-files audio-file)) + (outputs (cj/--transcription-output-files (or output-base audio-file))) (txt-file (car outputs)) (log-file (cdr outputs)) (buffer-name (format " *transcribe-%s*" (file-name-nondirectory audio-file))) @@ -371,7 +375,9 @@ FILE.log with process logs. Uses the backend in (cj/--extract-audio-from-video path extracted (lambda () - (cj/--start-transcription-process extracted extracted)))))))) + ;; Pass the source video as the output base so the .txt/.log land + ;; alongside it, not next to the temp /tmp audio. + (cj/--start-transcription-process extracted extracted path)))))))) ;;;###autoload (defun cj/transcribe-media-at-point () |
