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";
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
);
setTimeout(() => browser.close(), 10000);