A event voice for Vue.js, using SpeechSynthesis browser natives, support both Vue 1.0 and 2.0. See Vue documentation for more detail.
You can install it via yarn or npm.
$ yarn add simple-voice
$ npm install --save simple-voice
When used with a module system, you must explicitly install the bus via Vue.use():
import Vue from 'vue';
import SimpleVoice from 'simple-voice';
Vue.use(SimpleVoice);
You can optionally pass in some options:
Vue.use(SimpleVoice, {
voice: 'pt-BR',
rate: 1.2
});
The default is pt-BR. See the full list of voices here.
// ...
mounted() {
this.voice();
},
methods: {
voice() {
this.$voice('Hello world!');
}
}