Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Add support for Speech Recognition #80

Closed
kubawolanin opened this issue Dec 4, 2016 · 7 comments
Closed

Add support for Speech Recognition #80

kubawolanin opened this issue Dec 4, 2016 · 7 comments
Labels

Comments

@kubawolanin
Copy link
Contributor

kubawolanin commented Dec 4, 2016

Hello!
I've been thinking about implementing speech recognition capability in HABPanel.
I'm utilizing webkitSpeechRecognition for that (but may end up with SpeechRecognition)
So far I've managed to add an icon to the dashboard header and display the speech output on the top, like this:

speech

The "bullhorn" icon is temporary - apparently bootstrap's Glyphicon collection doesn't have any microphone icon ;-)

The idea is to display the output text at the time of speaking - after the result is final, it should hide the <span> element containing the text and then pass the output to the VoiceCommand item in openHAB.

Now two questions:

  1. Is it possible for me to get Voice Command Item (from the Rule Voice Interpreter setting)? Ideally, I'd like to retrieve it from REST, but couldn't find it. If it's not possible, then we'd need our users to select it in Settings.
  2. @ghys would you mind me extending current SpeechService or you'd rather see it somewhere else? Currently I'm coding simple POC inside dashboard.view.controller but I'm thinking on better place for the logic.

Thank you,
Kuba

@kaikreuzer
Copy link
Member

1.) You should note that VoiceCommand is outdated by now, see here. So I would suggest to directly use the new REST endpoint (and you then do not have to rely on the existence of a specific icon).

@kubawolanin
Copy link
Contributor Author

Hi @kaikreuzer thanks for the response.
I wasn't aware of that, so I'll take a look. At a glance it looks exactly what I'm looking for :)
As for the icon - I'm not relying on glyphicons ;) svg to the rescue!

@ghys
Copy link
Member

ghys commented Dec 5, 2016

Cool, I actually considered doing it along with the TTS support but due to a number of potential issues I figured it could be delayed.
So I'll share my thoughts from that time:

  • Safari doesn't support it, therefore no iOS, no IE/Edge/Firefox either, only Chrome: see http://caniuse.com/#search=speech - in any case the icon should be hidden if the feature is not available for any reason;
  • be aware there might not be room to display the text (think phones and tablets in portrait mode), maybe an overlay is more appropriate.

Extending the SpeechService with STT looks good to me.

@xylo
Copy link

xylo commented Dec 13, 2016

This sounds like a nice feature. Do you know if the speech recognition works offline (not server-based)?

@kubawolanin
Copy link
Contributor Author

kubawolanin commented Dec 13, 2016

Hey @xylo
No, unfortunately. I'm targeting webkit-based browsers here, meaning that it will work only on Chrome (ver >=33). And AFAIK Chrome is utilizing Cloud Speech API for that.
I didn't test it on Firefox, because I'm using webkitSpeechRecognition either way, but according to Mozilla's docs on that matter it could work if enabled in browser's settings.

@xylo
Copy link

xylo commented Dec 13, 2016

@kubawolanin
Thanks for the info.

@kubawolanin
Copy link
Contributor Author

Implemented in #95 - closing this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants