Skip to content

tscritch/wavesurfer-record-plugin-wav

Repository files navigation

Wavesurfer Record Plugin Wav

NPM NPM GitHub Workflow Status

Replacement Wavesurfer.js Record Plugin for recording .wav files. Uses the extendable-media-recorder to encode to wav.

Getting started

Installation

npm install wavesurfer-record-plugin-wav
yarn install wavesurfer-record-plugin-wav

Example

Songleaf - Audio Workbench

Usage

Use this as you would the default Wavesurfer.js Record Plugin

When creating and registering the plugin, make sure to set mimeType to "audio/wav"

import WaveSurfer from "wavesurfer.js"
import RecordPlugin from "wavesurfer-record-plugin-wav"

...

wavesurfer = WaveSurfer.create(...)

record = wavesurfer.registerPlugin(RecordPlugin.create({
  mimeType: "audio/wav",
}))

See the example usage here - https://wavesurfer.xyz/examples/?record.js

Caveats

Because extendable-media-recorder does not support MediaRecorder.requestData (MDN) function the RecordPlugin.pause() will not function properly. I've left it in for parity but it noops.