1.0.5 • Published 3 years ago
react-gnani-speech v1.0.5
react-gnani-speech
Installation
npm install --save react-gnani-speech
or
yarn add react-gnani-speech
Prerequisites
- You need access key and token to use gnani speech to text services.
- Please register at https://www.gnani.ai/api to get access key, token and lang code for your requirements
Usage
import React from 'react';
import SpeechToText from 'react-gnani-speech';
function Demo(){
return(
<React.Fragment>
<div>
<SpeechToText
onResponse={(text) => {
console.log("response text ", text);
}}
onFinalResponse={(text) => {
console.log("final text ", text);
}}
onFailure={(reasonText) => {
console.log("failure text ", reasonText);
}}
lang="en-IN"
token="your token"
accessKey="your access key"
style={{
height: "6rem",
width: "6rem",
border: "1px",
borderRadius: "50%",
margin: "5rem",
fontSize: "1rem"
}}
/>
</div>
</React.Fragment>
)
}
export default Demo;