1.0.5 • Published 3 years ago

react-gnani-speech v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

react-gnani-speech

Installation

npm install --save react-gnani-speech

or

yarn add react-gnani-speech

Prerequisites

  1. You need access key and token to use gnani speech to text services.
  2. 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;