Fix lamejs import for MP3 encoding

Use static import instead of dynamic import to fix MPEGMode undefined error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
b1rdmania
2026-01-01 10:35:32 +00:00
parent 2492ab833a
commit 6cc0938bbf
+3 -3
View File
@@ -538,6 +538,7 @@
import { SoundfontMIDIPlayer } from './src/synthesis/SoundfontMIDIPlayer.ts';
import { MotifEngine } from './src/core/MotifEngine.ts';
import { unlockAudio } from './src/utils/audioUnlock.ts';
import lamejs from 'lamejs';
const NUM_BARS = 40;
const midiService = new MIDIService();
@@ -798,9 +799,8 @@
shareHint.textContent = 'Encoding MP3…';
// Lazy-load MP3 encoder
const lameMod = await import('lamejs');
const Mp3Encoder = lameMod.Mp3Encoder || (lameMod.default && lameMod.default.Mp3Encoder);
// Use statically imported lamejs
const Mp3Encoder = lamejs.Mp3Encoder;
if (!Mp3Encoder) throw new Error('MP3 encoder not available');
const channels = audioBuffer.numberOfChannels;