closeio / mic-recorder-to-mp3

Microphone Recorder to mp3
MIT License
241 stars 135 forks source link

The ScriptProcessorNode is deprecated #39

Open Cerawia opened 3 years ago

Cerawia commented 3 years ago

Hello, nice work! 👍

[Deprecation] The ScriptProcessorNode is deprecated. Use AudioWorkletNode instead. (https://bit.ly/audio-worklet)

This message appears on Chrome dev console. Should I be worried? Thanks!

hosnar commented 3 years ago

I would also like to know this. Thanks!

Cabritone commented 2 years ago

Do you have any plans to migrate the lib to use the AudioWorkletNode?

DASMACHETE commented 1 year ago

Hi iam having the same issue, maybe somebody tried to fix that warning?

So i think the code that needs to be modified is in the index.js at 15859:

this.processor = this.context.createScriptProcessor(0, 1, 1);

      // Add all buffers from LAME into an array.
      this.processor.onaudioprocess = function (event) {
        if (_this.timerToStart) {
          return;
        }

        // Send microphone data to LAME for MP3 encoding while recording.
        _this.lameEncoder.encode(event.inputBuffer.getChannelData(0));
      };

I found some infos how to migrate it but i dont know how to do it: https://stackoverflow.com/questions/68007500/how-to-migrate-to-audioworkletnode-from-scriptprocessornode

Maybe someone can make it work.