Skip to content

v2.0.0

Compare
Choose a tag to compare
@0x010C 0x010C released this 13 Aug 21:25
101a7c0

LinguaRecorder used internaly the native BaseAudioContext:createScriptProcessor interface. But it has been deprecated for a long time now, so it became mandatory to migrate to the new AudioWorklet API.

Given that their functioning is radically different, the choice was made to completely migrate to this new interface, dropping support of old browsers. Those changes required a deep rewrite of the library. We wanted to keep LinguaRecorder's API as unchanged as possible, but there are still a few minor breaking changes that happened.

Changelog

  • Migration from the old and deprecated createProcessorNode to the new AudioWorklet
  • Remove legacy code made for old-browser support
  • Code simplification by using "new" features: async/await, let, const, class,...
  • New LinguaRecorder.close() method to cleanly stop the audio recorder
  • New LinguaRecorder.setConfig(config) method to change config options on-the-fly
  • README enhancements
  • Minor demo updates

Migration note

Breaking changes:

  • A new file has now to be included: src/RecordingProcessor.js
  • on LinguaRecorder:
    • The methods start, pause, stop, cancel and toggle now return the current LinguaRecorder instance instead of a boolean.
    • The bufferSize configuration option has been removed.
  • The AudioRecord class now only accepts data when it is created. For this reason:
    • The constructor prototype has changed from AudioRecord(sampleRate) to AudioRecord(samples, sampleRate).
    • The push method was removed.

Browser compatibility

Note also that using AudioWorklet breaks the previous compatibility table. Supported browsers are now the following:

  • Firefox 76+
  • Chrome 66+
  • Firefox for androïd 79+
  • Chrome for androïd 66+
  • Microsoft Edge 79+
  • Safari 14.1+
  • Opera 53+