npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-web-speech

v0.2.3

Published

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

Downloads

47

Readme

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

| Prop | Type | Default | Descrtiption | |---|---|---|---| | v-model | Boolean | false | Used to bind recording state. Can be used to start recording (true) or stop recording (false).| | lang | String | Defaults to the HTML lang attribute value, or the user agent's language setting if that isn't set either. | Language to recognize speech. | | confidenceLimit | String | Number | 0.8 | Limit for confidence under which transcription will be filtered out. | | continuous | Boolean | false | Controls whether continuous results are returned for each recognition, or only a single result. | | interimResults | Boolean | false | Controls whether interim (not final) results should be returned. | | maxAlternatives | String | Number | 1 | Sets the maximum number of alternatives provided per result. | | grammar | String | null | Grammars that will be understood by the recognition. |


Slots

| Slot | Props | Descrtiption | |---|---|---| | input | String text | You 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

| Event | Returns | Descrtiption | |---|---|---| | results | Array | Returns array of transcripts filtered by confidenceLimit. | | resultsRaw | SpeechRecognitionResultList | Returns raw SpeechRecognitionResultList on onResult event without confidenceLimit filtering. | | unrecognized | null | Fires when confidenceLimit was not satisfied. When continuous prop is on, fires when no result satisfied confidenceLimit. | | error | Event | Fires native onerror event. | | start | Event | Fires native onstart event. | | end | Event | Fires native onend event. | | speechstart | Event | Fires native onspeechstart event. | | speechend | Event | Fires native onspeechend event. | | audiostart | Event | Fires native onaudiostart event. | | audioend | Event | Fires native onaudioend event. | | soundstart | Event | Fires native onsoundstart event. | | soundend | Event | Fires native onsoundend event. | | nomatch | Event | Fires native onnomatch event. |

Documentation for <vue-web-speech-synth>

Properties

| Prop | Type | Default | Descrtiption | |---|---|---|---| | v-model | Boolean | false | Used to bind playing state. Can be used to start speaking (true) or stop speaking (false).| | voice | SpeechSynthesisVoice | Default system voice. | Voice to use for voice synthesis. Get in the @list-voices event | | text | String | null | Text to be synthesised. | | rate | String | Number | 1 | Speed at which the utterance will be spoken at. | | pitch | String | Number | 1 | Pitch at which the utterance will be spoken at. |


Events

| Event | Returns | Descrtiption | |---|---|---| | list-voices | Array of SpeechSynthesisVoice | Returns array of available SpeechSynthesisVoice supported by system. | | error | Event | Fires native onerror event. | | end | Event | Fires native onend event. | | boundary | Event | Fires native onboundary event. |