@huluvu424242/honey-slideshow
Version:
Text to Speech component wich is reading texts from DOM elements.
21 lines (20 loc) • 637 B
JavaScript
import { Logger } from "../logging/logger";
export class Sprachsynthese {
constructor() {
this.sprachSynthese = window.speechSynthesis;
this.sprachSynthese.onvoiceschanged = () => {
this.voices = this.sprachSynthese.getVoices();
Logger.debugMessage("voices changed to: " + this.voices.join(","));
};
}
getSynthese() {
return this.sprachSynthese;
}
getVoices() {
Logger.infoMessage("call getVoices");
if (!this.voices) {
this.voices = this.sprachSynthese.getVoices();
}
return this.voices;
}
}