diff --git a/index.js b/index.js index bb57707..a5ed35c 100644 --- a/index.js +++ b/index.js @@ -129,7 +129,7 @@ async function AIChose() { const surah = await processAiData( surahData, JSON.parse(fs.readFileSync("./data/data.json")), - "./video.mp3", + "./audio/audio.webm", ); const generator = new VideosGenerator( @@ -137,7 +137,7 @@ async function AIChose() { { x264Preset: "ultrafast", }, - answers.highlightWords || settings.video.highlightWords, + answers.highlightWords, ); console.log(gradient.morning("Video processing")); @@ -173,7 +173,7 @@ async function APIChose() { { x264Preset: "ultrafast", }, - answers.highlightWords || settings.video.highlightWords, + answers.highlightWords, ); console.log(gradient.morning("Video processing")); diff --git a/src/modules/videosGenerator.js b/src/modules/videosGenerator.js index bcf7ef7..400bb98 100644 --- a/src/modules/videosGenerator.js +++ b/src/modules/videosGenerator.js @@ -101,7 +101,7 @@ export default class VideosGenerator { useTransitions: false, }, imageOptions: { - lastImageExtraDuration: 0, + lastImageExtraDuration: 1000, }, }); @@ -126,7 +126,7 @@ function trimAudio(buffer, start, end) { ffmpeg({ source: stream.Readable.from(buffer, { objectMode: false }) }) .format("mp3") .seek(start / 1000) - .duration((end - start) / 1000) + .duration((end + 1000 - start) / 1000) .writeToStream(outputBufferStream); }); }