To start using a plugin, you need to insert the plugin library into your HTML page, alongside wavesurfer.js
, like this:
<script src="https://unpkg.com/wavesurfer.js@6.6.4/dist/wavesurfer.min.js"></script>
<script src="https://unpkg.com/wavesurfer.js@6.6.4/dist/plugin/wavesurfer.regions.min.js"></script>
You need to include the plugin's configuration when creating an instance of WaveSurfer
:
var wavesurfer = WaveSurfer.create({
container: '#waveform',
plugins: [
WaveSurfer.regions.create({})
]
});
node_modules
with the wavesurfer.js package, but they must first be
imported or required locally in order to use them:
// ES6: import RegionsPlugin from "wavesurfer.js/dist/plugin/wavesurfer.regions.min.js";
var RegionsPlugin = require("wavesurfer.js/dist/plugin/wavesurfer.regions.min.js");
var wavesurfer = WaveSurfer.create({
container: '#waveform',
plugins: [
RegionsPlugin.create({})
]
});
Adds ability to display and interact with audio regions. Regions are visual overlays that can be resized and dragged around the waveform. You can play back and loop a region.
Adds a nice simple timeline to your waveform. By Instajams.
Visualizes audio input from a microphone. By Thijs Triemstra.
Adds a minimap preview of your waveform. By Enton Biba.
Adds a playlist feature to your waveform. By Enton Biba.
Shows a cursor on your waveform.
Shows a spectrogram for your waveform.
Shows markers for your waveform.