blmage / duolingo-tts-controls

A small browser extension providing playback controls for some of the challenges on Duolingo.
MIT License
21 stars 4 forks source link

Allow slower playback other than 0.5 or 1.0 #122

Closed evandrocoan closed 2 months ago

evandrocoan commented 2 months ago

The default slower audio only allows 1.0, but it is not enough because the default slow speed is still too fast for some languages.

image image

It would be a line to allow slower speeds other than 0.5 and 1.0, such as 0.1 and 0.5.

I hope to change this line from 1.0 : 0.5 to 0.5 : 0.1 will be enough: https://github.com/blmage/duolingo-tts-controls/blob/0cabed3db0425c3eeaa84d63ce884cb4aca027ac/src/tts.js#L40-L43

I could not test it because I could not build the extension:

npm install
npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at:
npm ERR!     https://www.npmjs.com/forgot
npm ERR!
npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR!     npm login
evandrocoan commented 2 months ago

I managed to edit the extension minified code, changing Yo=e=>Za(Ua,Da===e?1:.5) to Yo=e=>.1 inside ui.js. However, the user interface only allows up to 0.5 as the minimum. But 0.5 works fine for the slower audio, as the original audio is already slower.

blmage commented 2 months ago

Thanks for the suggestion! This should be available in version 2.7.0 soon.

I could not test it because I could not build the extension:

This is because the extension uses FontAwesome Pro icons, and installing the corresponding package requires a private token (if needed at some point, I may consider solutions to work around this limitation).

However, the user interface only allows up to 0.5 as the minimum.

This is a hard limit from the Howler.js library used by Duolingo, which does not allow rate values below 0.5.

evandrocoan commented 2 months ago

Thanks for the fast response and for adding it to the stable version. I opened a feature request on Howler.js to allow values below 0.5 to the slider. Let's wait and see what they think about it.