1.0.0 • Published 7 years ago
stencil-voice2text v1.0.0
stencil-voice2text
wc-voice2text is a web component built with Stencil that allows you to use the Web Speech API.
Getting Started
To try this component:
git clone git@github.com:Fdom92/stencil-voice2text.git
cd my-app
git remote rm originand run:
npm install
npm startUsing this component
Script tag
- 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>Node Modules
- 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>In a stencil-starter app
- 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>
Parameters
| 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. |