fix(audio): offline mix limiter -3dBFS, 2-stage normalize (-14 LUFS + hard peak -1 dBTP), OGG export

This commit is contained in:
2026-08-24 09:10:00 +07:00
parent 10997a65b9
commit 708e7de32b
7 changed files with 221 additions and 96 deletions
+6 -5
View File
@@ -18333,8 +18333,8 @@ const App = () => {
loop: false,
loopBars: 4,
dither: false,
normalize: false,
normalizeTarget: '-1dbtp',
normalize: true,
normalizeTarget: '-14lufs',
monoCheck: true,
// Gap 13: BWF/INFO metadata cho WAV mastering export
metaTitle: '',
@@ -27969,7 +27969,8 @@ const App = () => {
try {
const schema = serializeProjectToSchema(currentProjectId || 'temp_project', projectName || 'Dự án tạm chưa lưu', bpm, tracks, subTabs, sessionTabs, masteringSettings, masterVolume, { volL: masterVolL, volR: masterVolR, link: masterLink, muted: masterMuted });
const isFloat = exportSettings.bitDepth === 'float';
const res = await window.SonicAPI.renderProject(schema, 'master_' + Date.now() + '.wav', {
const outExt = exportSettings.format === 'ogg' ? 'ogg' : 'wav';
const res = await window.SonicAPI.renderProject(schema, 'master_' + Date.now() + '.' + outExt, {
bit_depth: isFloat ? 32 : parseInt(exportSettings.bitDepth) || 16,
sample_rate: parseInt(exportSettings.sampleRate) || 44100,
dither: !!exportSettings.dither,
@@ -27990,12 +27991,12 @@ const App = () => {
const br = await fetch(res.url);
if (!br.ok) throw new Error('HTTP ' + br.status);
const b = await br.blob();
const sp = await saveExportViaDialog((projectName || 'Project') + '_master.wav', b);
const sp = await saveExportViaDialog((projectName || 'Project') + '_master.' + outExt, b);
if (sp) showToast(`Đã lưu → ${sp}`, 'success');
} catch (e) {
const a = document.createElement('a');
a.href = res.url;
a.download = 'master.wav';
a.download = 'master.' + outExt;
a.click();
}
});