A few months ago, I wrote an article onweb speech recognition using TensorflowJS.
Even though it was super interesting to implement, it was cumbersome for many of you to extend.
The secret is Chrome (or Chromium)Web Speech API.

40% off TNW Conference!
Here is the current support status.
Additionally, it only works online, so you will need a different setup if you are offline.

Can I use it?
For simplicity, we will use create-react-app to set up our project.
Next, we will work on the fileApp.js.

CRA (create-react-app) creates a good starting point for us.
Just kidding, we wont need any of it, so start with a blankApp.jsfile and code with me.
Before we can do anything, we need theimports:
Pretty easy, right?

Lets see in detail what we are doing, starting with theuseSpeechRecognitionhook.
This hook is responsible for capturing the results of the speech recognition process.
Its our gateway to producing the desire results.

But what happens if your net online gate is not supported?
Can we have a fallback behavior for those scenarios?
Yes, we can.

Building this functionality will make it possible for us to build apps that can fully function by voice.
Hopefully, in the near future, well see this API supported by more browsers and with offline capabilities.
Then, it will become a very powerful API that may change the way we build the web.

Sign up for updates on everything related to programming, AI, and computer science in general.
Also tagged with
