Socket
Socket
Sign inDemoInstall

vue-web-speech

Package Overview
Dependencies
11
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-web-speech

Vue wrapper for Web Speech API for recognizing voice and speech synthesis


Version published
Weekly downloads
28
increased by16.67%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

vue-web-speech

Vue wrapper for Web Speech API for voice recognition.
Package contains two components <vue-web-speech> for voice recognition and <vue-web-speech-synth> for voice synthesis.
Web Speech API is in experimental phase, check browser compatibility before using in production.

Installation

npm i vue-web-speech

Demo

Usage

Inject plugin to your vue instance by Vue.use

import Vue from 'vue'
import VueWebSpeech from 'vue-web-speech'

...

Vue.use(VueWebSpeech)

Then use it as component

<template>
    <vue-web-speech
      v-model="record"
      @results="onResults"
    />
    <vue-web-speech-synth
      v-model="play"
    />
</template>

Documentation for <vue-web-speech>

Properties

PropTypeDefaultDescrtiption
v-modelBooleanfalseUsed to bind recording state. Can be used to start recording (true) or stop recording (false).
langStringDefaults to the HTML lang attribute value, or the user agent's language setting if that isn't set either.Language to recognize speech.
confidenceLimitString | Number0.8Limit for confidence under which transcription will be filtered out.
continuousBooleanfalseControls whether continuous results are returned for each recognition, or only a single result.
interimResultsBooleanfalseControls whether interim (not final) results should be returned.
maxAlternativesString | Number1Sets the maximum number of alternatives provided per result.
grammarStringnullGrammars that will be understood by the recognition.

Slots

SlotPropsDescrtiption
inputString textYou can use this slot as visualization of speech result array. text is string of made of joined arrays by \n.

Example of input slot

<vue-web-speech>
    <template v-slot:input="{text}">
        <textarea :value="text" />
    </template>
</vue-web-speech>

Events

EventReturnsDescrtiption
resultsArrayReturns array of transcripts filtered by confidenceLimit.
resultsRawSpeechRecognitionResultListReturns raw SpeechRecognitionResultList on onResult event without confidenceLimit filtering.
unrecognizednullFires when confidenceLimit was not satisfied. When continuous prop is on, fires when no result satisfied confidenceLimit.
errorEventFires native onerror event.
startEventFires native onstart event.
endEventFires native onend event.
speechstartEventFires native onspeechstart event.
speechendEventFires native onspeechend event.
audiostartEventFires native onaudiostart event.
audioendEventFires native onaudioend event.
soundstartEventFires native onsoundstart event.
soundendEventFires native onsoundend event.
nomatchEventFires native onnomatch event.

Documentation for <vue-web-speech-synth>

Properties

PropTypeDefaultDescrtiption
v-modelBooleanfalseUsed to bind playing state. Can be used to start speaking (true) or stop speaking (false).
voiceSpeechSynthesisVoiceDefault system voice.Voice to use for voice synthesis. Get in the @list-voices event
textStringnullText to be synthesised.
rateString | Number1Speed at which the utterance will be spoken at.
pitchString | Number1Pitch at which the utterance will be spoken at.

Events

EventReturnsDescrtiption
list-voicesArray of SpeechSynthesisVoiceReturns array of available SpeechSynthesisVoice supported by system.
errorEventFires native onerror event.
endEventFires native onend event.
boundaryEventFires native onboundary event.

Keywords

FAQs

Last updated on 10 Mar 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc