lichess.org
Donate

The sound moves have changed (castling, takes)

Hello,
The sound moves have changed (castling, takes)
I liked the one before. I find it irritating to the ears.
I adapted the script that plays sounds in a user script for greasemonkey. However, I have not studied how to change the sounds that would be hosted elsewhere.

Any help is welcome

[code]
// ==UserScript==
// @name Lichess Sound replacement
// @namespace http://en.lichess.org
// @version 1.0
// @description replace sound
// @match http://*.lichess.org/*
// ==/UserScript==

$.sound = (function() {
var baseUrl = $('body').data('sound-dir');
var makeAudio = function(file, volume) {
var a = new Audio(baseUrl + '/' + file);
a.volume = volume;
return a;
};
var audio = {
dong: makeAudio('dong.ogg', 1),
moveW: makeAudio('move.ogg', 0.6),
moveB: makeAudio('move.ogg', 0.6),
take: makeAudio('move.ogg', 0.6)
};
var canPlay = !! audio.moveW.canPlayType && audio.moveW.canPlayType('audio/ogg; codecs="vorbis"');
var $toggle = $('#sound_state').toggleClass('sound_state_on', storage.get('sound') == 1);
var enabled = function() {
return $toggle.hasClass("sound_state_on");
};
var shouldPlay = function() {
return canPlay && enabled();
};
var play = {
move: function(white) {
if (shouldPlay()) {
if (white) audio.moveW.play();
else audio.moveB.play();
}
},
take: function() {
if (shouldPlay()) audio.take.play();
},
dong: function() {
if (shouldPlay()) audio.dong.play();
}
};
if (canPlay) $toggle.click(function() {
$toggle.toggleClass('sound_state_on', !enabled());
if (enabled()) storage.set('sound', 1);
else storage.remove('sound');
play.dong();
return false;
});
else $toggle.addClass('unavailable');

return play;
})();
[/code]
Well, the problem seems to come from browser, in fact, I use firefox on the Nightly channel, currently 34.0a1 Version

And for less than a week, firefox manages very badly sound from this site.

I just sent a feedback to mozilla which here is the Permalink:
input.mozilla.org/en-US/dashboard/response/4547639

This topic has been archived and can no longer be replied to.