style: auto-fix linting issues
This commit is contained in:
parent
1c1d202e91
commit
4aaffd2c22
6 changed files with 51 additions and 43 deletions
|
|
@ -51,9 +51,12 @@ async function encodeToMp3Worker(audioBlob, onProgress = null, signal = null) {
|
|||
};
|
||||
|
||||
// Transfer audio data to worker
|
||||
worker.postMessage({
|
||||
audioData
|
||||
}, [audioData]);
|
||||
worker.postMessage(
|
||||
{
|
||||
audioData,
|
||||
},
|
||||
[audioData]
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ async function loadFFmpeg() {
|
|||
type: 'progress',
|
||||
stage: 'encoding',
|
||||
progress: progress * 100,
|
||||
time
|
||||
time,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ async function loadFFmpeg() {
|
|||
const baseURL = 'https://unpkg.com/@ffmpeg/core@0.12.6/dist/esm';
|
||||
await ffmpeg.load({
|
||||
coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`, 'text/javascript'),
|
||||
wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`, 'application/wasm')
|
||||
wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`, 'application/wasm'),
|
||||
});
|
||||
})();
|
||||
|
||||
|
|
@ -49,12 +49,17 @@ self.onmessage = async (e) => {
|
|||
|
||||
// Encode to MP3 with 320kbps CBR, strip source metadata to avoid duplicate ID3 tags
|
||||
await ffmpeg.exec([
|
||||
'-i', 'input',
|
||||
'-map_metadata', '-1',
|
||||
'-c:a', 'libmp3lame',
|
||||
'-b:a', '320k',
|
||||
'-ar', '44100',
|
||||
'output.mp3'
|
||||
'-i',
|
||||
'input',
|
||||
'-map_metadata',
|
||||
'-1',
|
||||
'-c:a',
|
||||
'libmp3lame',
|
||||
'-b:a',
|
||||
'320k',
|
||||
'-ar',
|
||||
'44100',
|
||||
'output.mp3',
|
||||
]);
|
||||
|
||||
self.postMessage({ type: 'progress', stage: 'finalizing', message: 'Finalizing MP3...' });
|
||||
|
|
|
|||
Loading…
Reference in a new issue