question

April L. Hamilton avatar image
April L. Hamilton asked

Javascript Web Speech API?

Is the Javascript Web Speech API supported? I'm talking about SpeechSynthesis() and SpeechRecognition(), specifically.
alexa skills kitdebugging
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

James Chivers avatar image
James Chivers answered
All speech input to the Echo, and spoken output from the Echo goes via the physical unit, so I'm not sure how you would use the Web Speech API? Is there a specific use case you're working on that needs web-based speech input, say via a browser, and then interfaces with the Alexa backend?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

April L. Hamilton avatar image
April L. Hamilton answered
No, James. I was just looking at the Java sample code Amazon provides and see that it employs Java speechlet methods, so it got me wondering if I could approach my code the same way, but using Javascript's Web Speech API. On the one hand it seems obvious that whatever's happening on the server side shouldn't matter once you've got it parsed out to JSON, but since this is a whole new world of browser-less interaction I thought maybe it's not safe to make [i]any[/i] assumptions.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

James Chivers avatar image
James Chivers answered
Ah, thanks for the context. From what I've seen of the Web Speech API, I don't think it'll be much help for building Echo apps, or rather, I don't see how you could integrate it and it be useful to you :) However, I get the idea of maybe using some of the elements or concepts of the API on the backend to process speech, but, as you say, it's just JSON being shunted back and forth between Alexa and your server so all the speech processing magic happens at Amazon outside of your app. You've got me thinking though - you could probably write something with the Web Speech API running in Chrome, and have the Echo converse with some remote app/service via a nearby mic + speaker :)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

April L. Hamilton avatar image
April L. Hamilton answered
For a dev like me who came up through the browser wars and remembers all too well what it was like having to write "sniffers" to detect browser type and version, it's sometimes difficult to wrap my head around purely server-side development of apps that STILL interact with the user. It's like I get it at the intellectual level, but all my developer instincts and assumptions are still tuned to the browser. Echo development actually opens up whole new worlds of user experience we've never even considered before, such as your idea to employ a browser element in an Echo app, but so much of what I've internalized about app development to date has to go right out the window. It's exciting, though. :D
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nick Gardner avatar image
Nick Gardner answered
The previous responses regarding the javascript questions are substantially correct, your app ends up simply parsing JSON data and responding in kind at the very core, and does not have to do any of the speech processing or interpretation itself. Alexa AppKit development is almost a completely different paradigm from most normal app development. One of the hardest parts is thinking through what the user flow will be in your app, and how to make it as intuitive and smooth for the end user who hasn't read a whole page of intents on your app. It requires quite a bit of time to get used to and internalize. Thanks, Nick
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.