Reputation: 6270
I can use wavesurfer.js to play audio. Now I would like to add some filters (high & low pass) so that I can edit the audio. With wavesurfer player I can do fast forward, pause audio and then I want to apply filters on particular section. Basically I want control over audio play and apply filters on it.
What are the ways to achieve this?
Upvotes: 2
Views: 2560
Reputation: 17899
You can add filters via the method setFilter
:
var lowpass = wavesurfer.backend.ac.createBiquadFilter();
wavesurfer.backend.setFilter(lowpass);
You can do this during playback, it will rewire itself automatically.
The filter node is connected to wavesurfer's gain node, which in turn is connected to the final destination (speakers).
See https://github.com/katspaugh/wavesurfer.js#connecting-filters
P.S. I've pushed this just now. Thanks for highlighting the issue!
Upvotes: 2