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
This commit is contained in:
Azeufack Noupeu Willy
2025-11-20 14:05:52 +01:00
parent 4b72568ad3
commit a0ed2ab7bd
+10 -2
View File
@@ -1,3 +1,5 @@
const EventEmitter = require('events');
const audioEvents = new EventEmitter();
// Ensure ffmpeg binary is available // Ensure ffmpeg binary is available
if (!ffmpegPath) { if (!ffmpegPath) {
@@ -75,6 +77,12 @@ module.exports = {
progressBar.update(100, { timemark: 'done' }); progressBar.update(100, { timemark: 'done' });
progressBar.stop(); progressBar.stop();
console.log(`Extraction completed: ${outputAudioPath}`); console.log(`Extraction completed: ${outputAudioPath}`);
audioEvents.emit('audio_ready', {
sessionId: inputVideoName,
audioPath: outputAudioPath
});
resolve(); resolve();
}) })
.on('error', (err) => { .on('error', (err) => {
@@ -88,6 +96,6 @@ module.exports = {
console.log(); console.log();
} }
}); });
} },
audioEvents: audioEvents
} }