simple-voice
v0.1.6
Published
A event voice for Vue.js, using [SpeechSynthesis](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis) browser natives, support both Vue 1.0 and 2.0. See Vue [documentation](https://vuejs.org/v2/guide/migration.html#Events) for more detail.
Downloads
15
Readme
simple-voice
A event voice for Vue.js, using SpeechSynthesis browser natives, support both Vue 1.0 and 2.0. See Vue documentation for more detail.
Installation
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.
Usage
Listen and clean
// ...
mounted() {
this.voice();
},
methods: {
voice() {
this.$voice('Hello world!');
}
}