There is no native Javascript SpeechSyntesis library per Web Speech API.
Would suggest executing `speechSynthesis.cancel()` before each use of `speechSynthesis` at Chromium to clear the synthesis queue, defining a single instance of `speechSynthesis`, `const synth = speechSynthesis`, execute `let voices = synth.getVoices()` outside of `onvoiceschanged` event. `espeak-ng` voices begin with uppercase letter and `lang` is not set at Chromium.
`spd-conf` is in `python3-speechd` package.
```
(async() => {
const synth = speechSynthesis;
const text = [...Array(10).keys()].join(" ");
const handleVoicesChanged = async e => {
const voice = synth.getVoices().find(({
name
}) => name.includes("English"));
const utterance = new SpeechSynthesisUtterance(text);
utterance.voice = voice;
utterance.pitch = 0.33;
utterance.rate = 0.1;
const recorder = new MediaRecorder(stream);
recorder.start();
synth.speak(utterance);
}
synth.onvoiceschanged = handleVoicesChanged;
let voices = synth.getVoices();
console.log(voices);
if (voices.length) {
handleVoicesChanged();
};
})().catch(console.error);
```