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