Loading Audio Cutter...
${bodyContent}
`;
// 3. Manually execute the Audio Logic
// We use a Blob to execute the script in the global scope correctly
const scriptBlob = new Blob([scriptContent], { type: 'application/javascript' });
const scriptUrl = URL.createObjectURL(scriptBlob);
const newScript = document.createElement('script');
newScript.src = scriptUrl;
newScript.onload = () => {
console.log("Audio Logic Loaded");
// Force a resize event to draw the waveform correctly once visible
window.dispatchEvent(new Event('resize'));
};
document.body.appendChild(newScript);
})
.catch(err => {
document.getElementById('audio-tool-root').innerHTML = "Error loading Audio Cutter.";
console.error(err);
});
})();