Wavesurfer.js: How to create simple Volume Slider?? -- Gain Node -- setFilters ??

Created on 21 Jan 2017  路  9Comments  路  Source: katspaugh/wavesurfer.js

Hi! tried many things - does anyone have an example of how to add a volume slider HTML and JS ?

I have the equalizer example working though need to add a simple master volume fader
This is the equalizer example i hope to add a volume slider to
https://wavesurfer-js.org/examples/

BIG thanks!

question

Most helpful comment

All 9 comments

VERY VERY much appreciated!!! Bet it helps many of us.

I have enjoyed the Volume Slider - now I'm trying to find a way to modify the code from the link above to get the slider to reflect the correct position when i set DEFAULT VOLUME with this:

wavesurfer.setVolume(0.4);

REALLY hoping to some help with this - it's FANTASTIC to have the slider - and as i set a default volume to be much less than 100% loud - hoping to have the slider not show 100% full right position by default -

Long way of asking:

is there a way to have the slider follow the default volume I set with
wavesurfer.setVolume(0.4);

Sorry and thanks!!

Check the code for the zoom slider in the examples.

THANK YOU
No Luck yet
I had a go and I think it may be that there's no volumeLevel paramenter for setVolume?
hoping to have the slider for volume relect the actual default volume I'm setting with setVolume

wavesurfer.setVolume(0.4);

var slider = document.querySelector('#volume');

slider.oninput = function () {
var volumeLevel = Number(slider.value);
wavesurfer.setVolume(volumeLevel);
};

@tweed here you go, you may now use wavesurfer.getVolume(); with the latest version.
wavesurfer.setVolume(0.4); document.querySelector('#volume').value = wavesurfer.getVolume();

FANTASTICALLY HELPFUL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! the last puzzle piece - GREATEST thanks

Is it possible to do this with two channels ?
When you split channels do they get a name or an Id i can work with.
I want to be able to change the volume of each channel seperately.

document.querySelector('#volume').value = wavesurfer.getVolume();

Cannot get it... is there any code example?

Thanks in advance

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daslicht picture daslicht  路  3Comments

thijstriemstra picture thijstriemstra  路  5Comments

sebhoff picture sebhoff  路  4Comments

Mamadou99 picture Mamadou99  路  3Comments

Trojan0523 picture Trojan0523  路  3Comments