diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-19 23:03:06 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-19 23:03:06 +0300 |
| commit | b714194839f4245a5a8fb4ec1282453ea7b77e62 (patch) | |
| tree | a8a9bc5bbc0951d9ecb3c3c1cf269174f674596c /internal/comic/narrator.go | |
| parent | 31897cc877545d7c39c3dc56227bf3f1690965ee (diff) | |
x4: fix comic render failure handling and audio fallback
Diffstat (limited to 'internal/comic/narrator.go')
| -rw-r--r-- | internal/comic/narrator.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/internal/comic/narrator.go b/internal/comic/narrator.go index 461eb42..1b4365f 100644 --- a/internal/comic/narrator.go +++ b/internal/comic/narrator.go @@ -11,6 +11,8 @@ import ( "codeberg.org/snonux/comicforge/internal/provider" ) +var lookPath = exec.LookPath + // NarratorConfig configures narration generation. type NarratorConfig struct { TextProvider provider.TextProvider @@ -260,7 +262,7 @@ func splitIntoNarrationChunks(text string, targetWords int) []string { } func mixAmbientMusic(narrationFile, outputFile, tmpDir string) error { - ffmpegPath, err := exec.LookPath("ffmpeg") + ffmpegPath, err := lookPath("ffmpeg") if err != nil { return fmt.Errorf("ffmpeg not found") } @@ -308,7 +310,7 @@ func generateAmbientPad(ffmpegPath, outputFile string) error { } func concatenateMP3s(chunkPaths []string, outputFile, tmpDir string) error { - ffmpegPath, err := exec.LookPath("ffmpeg") + ffmpegPath, err := lookPath("ffmpeg") if err != nil { return fmt.Errorf("ffmpeg not found — required for multi-chunk narration: %w", err) } @@ -338,10 +340,10 @@ func concatenateMP3s(chunkPaths []string, outputFile, tmpDir string) error { } func convertToStereo(inputFile, outputFile string) error { - ffmpegPath, err := exec.LookPath("ffmpeg") + ffmpegPath, err := lookPath("ffmpeg") if err != nil { fmt.Println(" Warning: ffmpeg not found, narration will be mono") - return os.Rename(inputFile, outputFile) + return copyFile(inputFile, outputFile) } cmd := exec.Command(ffmpegPath, |
