import { BaseOutput } from './base-output';
export class WebTTSOutput extends BaseOutput {
    constructor(options = {}) {
        super();
        this.rate = options.rate || 1;
        this.synth = window.speechSynthesis;
    }
    speak(text) {
        let utterThis = new SpeechSynthesisUtterance(text);
        utterThis.rate = this.rate;
        this.synth.speak(utterThis);
    }
    stop() {
        this.synth.cancel();
    }
    setOptions(options) {
        this.rate = options.rate || 1;
    }
}
