Speech Recognition with JavaScript
source link: https://dev.to/joelbonetr/speech-recognition-with-javascript-59g1
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Speech Recognition with JavaScript
Cover image credits: dribbble
Some time ago, speech recognition API was added to the specs and we got partial support on Chrome, Safari, Baidu, android webview, iOS safari, samsung internet and Kaios browsers (see browser support in detail).
Disclaimer: This implementation won't work in Opera (as it doesn't support the constructor) and also won't work in FireFox (because it doesn't support a single thing of it) so if you're using one of those, I suggest you to use Chrome -or any other compatible browser- if you want to take a try.
Speech recognition code and PoC
Edit: I realised that for any reason it won't work when embedded so here's the link to open it directly.
The implementation I made currently supports English and Spanish just to showcase.
Quick instructions and feature overview:
- Choose one of the languages from the drop down.
- Hit the mic icon and it will start recording (you'll notice a weird animation).
- Once you finish a sentence it will write it down in the box.
- When you want it to stop recording, simply press the mic again (animation stops).
- You can also hit the box to copy the text in your clipboard.
If you want me to add support for more languages tell me in the comment sections and I'm updating it in a blink so you can test it on your own language 😁
That's all for today, hope you enjoyed I sure did doing that
Discussion (3)
Cool. I once created a speech based speech recognition thing based upon MySQL and SoundEx allowing me to create code by speaking through my headphones. It was based upon creating a hierarchical “menu” where I could say “Create button”. Then the machine would respond with “what button”, etc. The thing of course produced Hyperlambda though. I doubt it can be done without meta programming.
One thing that bothers me is that this was 5 years ago, and speech support has basically stood 100% perfectly still in all browsers since then … 😕
One thing that bothers me is that this was 5 years ago, and speech support has basically stood 100% perfectly still in all browsers since then … 😕
Not in all of them, (e.g. Opera mini, FireFox mobile), it's a nice to have in browsers, specially targeting accessibility, but screen readers for blind people do the job and, on the other hand, most implementations for any other purpose send data to a backend using streams so they can process the incoming speech plus use the user feedback to train an IA among others and without hurting the performance.
...allowing me to create code by speaking through my headphones... ... I doubt it can be done without meta programming.
I agree on this. The concept "metaprogramming" is extense and covers different ways in which it can work (or be implemented) and from its own definition it is a building block for this kind of applications.
CollapseExpand
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK