chrome-speech-recognition
v1.0.1
Published
Access chrome SpeechRecognition with puppeteer in headless mode
Downloads
2
Maintainers
Readme
chromeSpeechRecognition
Access chrome SpeechRecognition with puppeteer in headless mode
NOTE: You will need to put chrome in the source directory
Install
$ npm i chrome-speech-recognition
Import
import chromeSpeechRecognition from "chromeSpeechRecognition";
//or
const chromeSpeechRecognition = require("chromeSpeechRecognition").default;
Example
function callback(text) {
console.log("The user said: ", text);
}
const chromePath = path.resolve(__dirname, "../chrome/chrome.exe");
const speechRecognitionOptions = {
lang: "en",
};
const browser = await chromeSpeechRecognition(
callback,
chromePath,
speechRecognitionOptions
);
//when you want to stop listening
setTimeout(() => browser.close(), 10000);