
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
vue-web-speech
Advanced tools
Vue wrapper for Web Speech API for recognizing voice and speech synthesis
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.
npm i vue-web-speech
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>
<vue-web-speech>
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. |
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>
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. |
<vue-web-speech-synth>
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. |
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. |
FAQs
Vue wrapper for Web Speech API for recognizing voice and speech synthesis
The npm package vue-web-speech receives a total of 50 weekly downloads. As such, vue-web-speech popularity was classified as not popular.
We found that vue-web-speech demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.