A simple, single-file library for integrating speech recognition in Node.js applications using Google Cloud Speech-to-Text.
Before installing, ensure you have a Google Cloud project set up with the Speech API enabled and you have generated your credentials JSON file.
npm install simplest-speech-recognition
To use simplest-speech-recognition
, first set your Google Cloud credentials:
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/credentials-file.json"
Then, you can start recognizing speech with:
const { recognizeSpeech } = require('simplest-speech-recognition');
recognizeSpeech();
The library listens to the microphone input and logs the recognized text to the console.
- @google-cloud/speech: For speech recognition.
- node-record-lpcm16: For recording audio from the microphone.