@readybytes/rb-speech-to-text

0.1.1 • Public • Published

rb-text-to-speech

Demo

Demo

See live demo here at codesandbox.

Installation

npm install --save rb-speech-to-text

or

yarn add rb-speech-to-text

Declaration

<script>
import RBSpeechToText from "@readybytes/rb-speech-to-text";

export default {
  components: {
    RBSpeechToText
  }
}
<script>

Basic Usage

Example-1

<template>
  <div>
    <textarea v-model="body"></textarea>
    <RBSpeechToText
      :text="body"
      @speechend="body = $event.text"
    ></RBSpeechToText>
  </div>
<template>

<script>
export default {
  name: "MyComponent",
  data() {
		return {
			body: "Hello World",
		};
	},
}
</script>

Example-2

<template>
  <div>
    <textarea v-model="body"></textarea>
    <RBSpeechToText
      :text="body"
      lang="fr-FR"
      @speechend="body = $event.text"
    ></RBSpeechToText>
  </div>
<template>

<script>
export default {
  name: "MyComponent",
  data() {
		return {
			body: "Bonjour le monde",
		};
	},
}
</script>

Properties

Name Type Required Default Value Support Values
text String Yes - any string
lang String No "en-US" <languageCode-countryCode>.
BCP-47 Languages Codes (Go to this link and search for BCP-47 language codes)

Events

  • speechend

    This event will fire when user stop speaking and save the content. i.e-

     <template>
      <RBSpeechToText
        :text="text"
        @speechend="onSpeechEnd"
      >
      </RBSpeechToText>
     </template>
    
     <script>
      export default {
        methods:{
          onSpeechEnd(event) {
            console.log(event)
          }
        }
      }
     </script>
    
    

Package Sidebar

Install

npm i @readybytes/rb-speech-to-text

Weekly Downloads

1

Version

0.1.1

License

none

Unpacked Size

287 kB

Total Files

9

Last publish

Collaborators

  • neha_rbsl
  • nitesh.soni
  • raj-rbsl-npm
  • chandra_bhan_rb
  • ssv445