1

How can I turn off Google Translate's "slow down text-to-speech on second listen"? It's nothing but hugely irritating.

2

You can use this javascript code to turn it off:

const orig_setAttribute = HTMLElement.prototype.setAttribute;

Audio.prototype.setAttribute = function(key, value) {
    if (key === 'src') {
        value = value.replace(/([?&])ttsspeed=[0-9.]+($|&)/, (match, s1, s2) => {
            return s2 ? s1 : '';
        });
    }

    orig_setAttribute.call(this, key, value);
};

You need to paste it to the console every time you open the Google Translator site or just use Greasemonkey or somethink that executes it automatically.

Here is Greasemonkey version with added header:

// ==UserScript==
// @name        translate.google.com   —   Turn off slowing down text-to-speech
// @namespace   vitaliylag
// @match       *://translate.google.com/*
// @version     
// @grant       none
// ==/UserScript==



const orig_setAttribute = HTMLElement.prototype.setAttribute;

Audio.prototype.setAttribute = function(key, value) {
    if (key === 'src') {
        value = value.replace(/([?&])ttsspeed=[0-9.]+($|&)/, (match, s1, s2) => {
            return s2 ? s1 : '';
        });
    }

    orig_setAttribute.call(this, key, value);
};

Maybe someday I will create a browser extension for easy use but if I will it will not be soon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.