function speak(text, rate, array){
var utterThis = new window.SpeechSynthesisUtterance(text);
utterThis.voice = voices[voice];
utterThis.rate = rate;
let start, difference;
utterThis.onstart = function() { start = +new Date(); };
utterThis.onend = function() {
difference = +new Date() - start;
array.value = [...array.value, difference];
};
synth.speak(utterThis);
}