From 6cc0938bbf14e110c23a9281d473e81bf153d0e8 Mon Sep 17 00:00:00 2001 From: b1rdmania <102524336+b1rdmania@users.noreply.github.com> Date: Thu, 1 Jan 2026 10:35:32 +0000 Subject: [PATCH] Fix lamejs import for MP3 encoding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ux-test.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ux-test.html b/ux-test.html index c8b57d7..bdc338d 100644 --- a/ux-test.html +++ b/ux-test.html @@ -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;