mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-24 07:20:16 +05:30
feat(audio): implement ffmpeg-based audio operations backend
Adds AudioOperations.js with pure argument builders (convert/trim/extract/merge) plus one executeOperation that spawns ffmpeg via a dependency-injected execFileFn, so tests never invoke a real binary. Wires process-audio-operation in main.js and updates preload.js's ALLOWED_SEND_CHANNELS to replace the 5 stale audio-* entries. Amit Haridas
This commit is contained in:
+15
@@ -6,6 +6,7 @@ const { execFile } = require('child_process');
|
||||
const WordTemplateExporter = require('./wordTemplateExporter');
|
||||
const PDFOperations = require('./main/PDFOperations');
|
||||
const ImageOperations = require('./main/ImageOperations');
|
||||
const AudioOperations = require('./main/AudioOperations');
|
||||
const GitOperations = require('./main/GitOperations');
|
||||
const PdfFontHeader = require('./main/PdfFontHeader');
|
||||
const MonospaceFontConfig = require('./main/MonospaceFontConfig');
|
||||
@@ -4636,6 +4637,20 @@ ipcMain.handle('process-image-operation', async (event, { operation, data }) =>
|
||||
}
|
||||
});
|
||||
|
||||
// ========================================
|
||||
// AUDIO OPERATIONS — delegates to main/AudioOperations.js
|
||||
// ========================================
|
||||
|
||||
ipcMain.handle('process-audio-operation', async (event, { operation, data }) => {
|
||||
try {
|
||||
return await AudioOperations.executeOperation(operation, data, {
|
||||
ffmpegPath: getFFmpegPath(),
|
||||
});
|
||||
} catch (error) {
|
||||
return { success: false, error: sanitizeErrorMessage(error.message) };
|
||||
}
|
||||
});
|
||||
|
||||
// IPC Handler for folder selection (for batch image operations)
|
||||
ipcMain.on('select-image-folder', (event, inputId) => {
|
||||
const folder = dialog.showOpenDialogSync(mainWindow, {
|
||||
|
||||
Reference in New Issue
Block a user