Recipe: If You Want to Reduce The Sound Volume on The Site, You Can
This post was originally written by FieryCat for Duolingo forum.
If you want to reduce the volume of all Duolingo's sounds you can simply run this short script in your browser console when you are on the main page of the site, or you can add it to your user script:
Howler.volume(0.5);
The command above will set the sound volume to 50%. You may replace 0.5 with any number from 0.0 to 1.0 (from 0% to 100%).
Here are some examples:
Command | Action |
---|---|
Howler.volume(0.1); | Sets the sound volume to 10% |
Howler.volume(0.25); | Sets the sound volume to 25% |
Howler.volume(0.5); | Sets the sound volume to 50% |
Howler.volume(1); | Sets the sound volume to 100% |
Howler.volume(); | Gets the current volume level |
Howler.mute(true); | Mutes the sound |
Howler.mute(false); | Unmutes the sound |
Howler.mute(); | Does... nothig :) |
Now I will tell you some details.
A couple days ago, after I saw another post about sounds in Duolingo, I decided to see how Duolingo works with sound and found that Duolingo uses a library called Howler. Pretty quickly, I found the methods for global sound control I have written about in the begining of the post. But what about separate volume control of the sounds and voices on Duolingo? The library allows that. Then why are the sound effects and voices so different if volume from time to time? Why do Duolingo developers not use this functionality? They use it! If we look closely at the code that is downloaded into our browsers, we will see something that can be represented in the form of the table below:
Sound type | Sound source | Sound volume |
---|---|---|
BONUS | URL | 50% |
CORRECT | URL | 35% |
FAILED | URL | 50% |
INCORRECT | URL | 35% |
LEVEL_UP | URL | 50% |
PAGE | URL | 100% |
PASSED | URL | 50% |
RETRY | URL | 40% |
TEST | URL | 40% |
TIMER | URL | 60% |
It looks as if there was something wrong with the sounds initially and they were trying to fix it by adjusting the volume levels. Unfortunately, this JS code is closed from us. I do not have a short recipe how to change volume for the sounds in the list above and for other sounds, sorry. Do we need an option for sound volume control in the account settings? I personally do not need this setting, but... I just leave it here:
Have a good day and happy learning!
by dlhgl
I wonder if it is possible to use this to prevent turtle speech audio in the stories (where turtle speech is turned on when playing the audio more than 2 times)?
by FieryCat
Try this code there:
Howl.prototype.rate = function() { return this; };
This one will disable the method rate().
Added: Of course you need to run it when you are on the tab with the stories.
Comments
Post a Comment