wc-voice2text is a web component built with Stencil that allows you to use the Web Speech API.
To try this component:
git clone git@github.com:Fdom92/stencil-voice2text.git
cd my-app
git remote rm origin
and run:
npm install
npm start
- Put
<script src='https://unpkg.com/stencil-voice2text@latest/dist/voice2text.js'></script>
in the head of your index.html - Then you can use the element like this:
<wc-voice2text>
<input type="text"></input>
</wc-voice2text>
- Run
npm install stencil-voice2text --save
- Put a script tag similar to this
<script src='node_modules/stencil-voice2text/dist/voice2text.js></script>
in the head of your index.html - Then you can use the element like this:
<wc-voice2text>
<input type="text"></input>
</wc-voice2text>
- Run
npm install stencil-voice2text --save
- Add
{ name: 'stencil-voice2text' }
to your collections - Then you can use the element like this:
<wc-voice2text>
<input type="text"></input>
</wc-voice2text>
You can use it with ion input too, just import the ionic core collection:
<wc-voice2text> <ion-input></ion-input> </wc-voice2text>
Attribute | Default | Description |
---|---|---|
enabled | true | Make the speech recognition available or not |
continuous | false | Make the speech recognition ends when the user stops talking or continue. |
lang | en-US |
Make the speech recognition use english. |