I want to create an audio object in the blob but i couldn't.
const blobCode = () => {
    return `
    var sound      = document.createElement('audio');
    sound.id       = 'audio-player';
    sound.controls = 'controls';
    sound.src      = 'media/Blue Browne.mp3';
    sound.type     = 'audio/mpeg';
    document.body.appendChild(sound);
    class WhiteNoiseProcessor extends AudioWorkletProcessor {
    process (inputs, outputs, parameters) {
      const output = outputs[0]
      output.forEach(channel => {
        for (let i = 0; i < channel.length; i++) {
          channel[i] = Math.random() * 2 - 1
        }
      })
      return true
    }
  }
  
  registerProcessor('white-noise-processor', WhiteNoiseProcessor);`
}
const audioContext = new OfflineAudioContext(1, 128, 300000);
var blob_url = new Blob([blobCode()], {
    type: "text/javascript"
});
var blob_url_create = URL.createObjectURL(blob_url);
await audioContext.audioWorklet.addModule(blob_url_create).then(async () => {
    var wa = new AudioWorkletNode(audioContext, "white-noise-processor");
});
If i set the Blob type text/javascript get the error Uncaught ReferenceError: document is not defined
var blob_url = new Blob([blobCode()], {type: "text/javascript"});
If i set the Blob type text/html get the error Uncaught DOMException: The user aborted a request
var blob_url = new Blob([blobCode()], {type: "text/html"});
How do i resolve this error?
