From a0ed2ab7bdffecd1dd11b516aefee660bc9c936d Mon Sep 17 00:00:00 2001 From: Azeufack Noupeu Willy Date: Thu, 20 Nov 2025 14:05:52 +0100 Subject: [PATCH] feat(extraction): add audio_ready event emission - Add EventEmitter to emit audio_ready when extraction completes - Pass sessionId and audioPath in event data - Export audioEvents for Main process orchestrator Refs: S3-06 AC1,AC3,AC7 --- services/modules/extraction/ffmpegExtractor.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/services/modules/extraction/ffmpegExtractor.js b/services/modules/extraction/ffmpegExtractor.js index ffec9c0..7939cd5 100644 --- a/services/modules/extraction/ffmpegExtractor.js +++ b/services/modules/extraction/ffmpegExtractor.js @@ -1,3 +1,5 @@ +const EventEmitter = require('events'); +const audioEvents = new EventEmitter(); // Ensure ffmpeg binary is available if (!ffmpegPath) { @@ -75,6 +77,12 @@ module.exports = { progressBar.update(100, { timemark: 'done' }); progressBar.stop(); console.log(`Extraction completed: ${outputAudioPath}`); + + audioEvents.emit('audio_ready', { + sessionId: inputVideoName, + audioPath: outputAudioPath + }); + resolve(); }) .on('error', (err) => { @@ -88,6 +96,6 @@ module.exports = { console.log(); } }); - } - + }, + audioEvents: audioEvents } \ No newline at end of file