visliner.blogg.se

Javascript speech to text api
Javascript speech to text api











javascript speech to text api

#Javascript speech to text api code#

We are only going to review the code associated with our virtual assistant. The Speech Recognition API is big, and this is not going to be a deep dive. Most of them were based on answering, "What is the simplest option for this?" There was no real reason to overcomplicate things initially (that would come later, anyway.) and it was simple to draw.Īs you may have noticed, there's a pattern in most of our decisions. A cartoon of Frida Kahlo matched that perfectly. After all, we wanted something simple, but I have to admit that the results were a lot better than what we expected.Īnd why Frida Kahlo? The assistant is for a Spanish class, and we wanted a recognizable character associated with the Spanish language and culture. Also, it would reduce the learning curve to just the Web Speech API. We had plugged vanilla JavaScript into the school web tools on previous occasions, so it seemed like a good option. We cannot import content into websites (something that is related to the previous point.).We cannot access certain websites, as the school firewall blocks many of them (and the list is kind of ridiculous in some cases.).Therefore, building an app was not an option, which considerably limited the technologies we could use. The assistant was for a high school, and the school IT department has restrictions: And even when possible, there probably are better alternatives for building such a thing. Having a virtual assistant that analyzes speech and replies accordingly sounds like something that would require more than just vanilla JavaScript. After all, it was developed quickly in an afternoon -including the SVG- and it's less than 250 lines of code among HTML, JS, and CSS.īefore we continue, this is a demo of Frida (to see a running demo, go to the bottom of this article): It is still a work in progress and needs polishing, but it looks promising for what we want. Unfortunately, for now it only works in specific browsers because it uses two experimental Web APIs ( Speech Synthesis and Speech Recognition) that are not widely supported yet. It was built using vanilla JavaScript and an inline SVG. The cartoon is based on an illustration by El Creata An animated character who will listen and answer basic questions in Spanish. So, let me introduce you to our latest creation: Teacher Assistant Frida. The next school year is about to start, and my wife (a high-school Spanish teacher) had an idea for her class.













Javascript speech to text api