An easy-to-set-up playground for cross device real-time Google Speech Recognition with a Node server and socket.io. Phew.
- get a free test key from Google
- place it into the src folder and update the path in the
.env
file - open the terminal and go to the
src
folder - run
npm install
- run
node app.js
or with nodemon:nodemon app
- go to
http://127.0.0.1:1337/
Same as run local 1-4
.
- config the
.env
Port for a port that you've opened on the server. I'm using 1337 here, too. - go to
your server adress
I recommend using pm2 or something similar, to keep the process running even when closing the terminal connection.
- Speech Recognition controlled Face Filter: Christmas Card
- Face Filter / Analyzer with Speech Recognition: I Love You Trainer
It's possible to set a recognition context / add misunderstood words for better recognition results in the app.js request
params. For more details on the configuration, go here.
For other languages than english, look up your language code.
Google Cloud sends intermittent responses to the uploaded audio stream. Each response from Google Cloud contains the current estimation of the full sentence for the streamed audio.
When Google Cloud senses that the audio has reached an end of sentence, it will issue a response with an isFinal
flag set to true. Once this flag is issued, the client will finalize the sentence and write it to the document.
This process is repeated until the user ends the recording.
The client application highlights different parts of speech, such as nouns and verbs, by using this natural language processing library.
The client communicates with the server using Socket.io.
- If you have delays in calls, check if
IPV6
is disabled on your server
There is now a super reduced log only verison. It show's only two buttons, logs the results to the console and has no nlp. Use this if you want to implement it somewhere else.
Made by Vinzenz Aubry