$(document).on('click', '#mask', function() { ... });
Audio Stereo Panning
HTML5 Audio currently has no way of panning audio tracks left or right (adjusting the balance). Recommend adding a HTMLMediaElement.balance property, floating point decimal, with a range of "-1" (full left speaker), to «0.0» (center, both channels at full volume), to «1.0» (full right speaker). This should work on both mono and stereo tracks.
var sound = new Audio('env/water-loop.mp3'); sound.balance = -1; // full left speaker sound.play();
Changing this value should have an immediate effect on audio that is already playing — i.e. balance should not be buffered.
$('.r-slider').slider({
range: true,
min: 0,
max: 500,
values: [ 75, 300 ],
slide: function( event, ui ) {
console.log($(event.srcElement).index());
// 1 - left
// 2 - right
}
});