khucxuanquy / vue-listen-voice

A nice component listen voice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vue-listen-voice

Install

npm install vue-listen-voice

Usage

import Vue from 'vue'
import VueListenVoice from "vue-listen-voice";

Vue.use(VueListenVoice);
<template>
  <div>
    <button
      @click="isListen = !isListen"
      v-text="isListen ? 'stop' : 'start'"
    />

    <vue-listen-voice
      :listen="isListen"
      @textFromSpeech="textFromSpeech"
    />
  </div>
</template>

<script>
export default {
  data() {
    return {
      isListen: false,
    }
  },
  methods: {
    textFromSpeech (text) {
      console.log('textFromSpeech: ', text)
    }
  }
}
</script>

Documentation

Properties

prop type default Descrtiption
listen Boolean false Can be used to start recording or stop recording
language String en-US language to recognize speech. you can check supported languages here

Events

Event Return Descrtiption
textFromSpeech String Returns the words that vue-listen-voice hears

Issues and features requests

If you find something that doesn't work, or a feature request at https://github.com/khucxuanquy/vue-listen-voice/issues

About

A nice component listen voice


Languages

Language:JavaScript 71.0%Language:Vue 29.0%