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
|
// Transfer audio data to worker
|
||||||
worker.postMessage({
|
worker.postMessage(
|
||||||
audioData
|
{
|
||||||
}, [audioData]);
|
audioData,
|
||||||
|
},
|
||||||
|
[audioData]
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ async function loadFFmpeg() {
|
||||||
type: 'progress',
|
type: 'progress',
|
||||||
stage: 'encoding',
|
stage: 'encoding',
|
||||||
progress: progress * 100,
|
progress: progress * 100,
|
||||||
time
|
time,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -28,7 +28,7 @@ async function loadFFmpeg() {
|
||||||
const baseURL = 'https://unpkg.com/@ffmpeg/core@0.12.6/dist/esm';
|
const baseURL = 'https://unpkg.com/@ffmpeg/core@0.12.6/dist/esm';
|
||||||
await ffmpeg.load({
|
await ffmpeg.load({
|
||||||
coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`, 'text/javascript'),
|
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
|
// Encode to MP3 with 320kbps CBR, strip source metadata to avoid duplicate ID3 tags
|
||||||
await ffmpeg.exec([
|
await ffmpeg.exec([
|
||||||
'-i', 'input',
|
'-i',
|
||||||
'-map_metadata', '-1',
|
'input',
|
||||||
'-c:a', 'libmp3lame',
|
'-map_metadata',
|
||||||
'-b:a', '320k',
|
'-1',
|
||||||
'-ar', '44100',
|
'-c:a',
|
||||||
'output.mp3'
|
'libmp3lame',
|
||||||
|
'-b:a',
|
||||||
|
'320k',
|
||||||
|
'-ar',
|
||||||
|
'44100',
|
||||||
|
'output.mp3',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
self.postMessage({ type: 'progress', stage: 'finalizing', message: 'Finalizing MP3...' });
|
self.postMessage({ type: 'progress', stage: 'finalizing', message: 'Finalizing MP3...' });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue