manniru / android-xbmcremote

Automatically exported from code.google.com/p/android-xbmcremote
0 stars 0 forks source link

Voice Control #341

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We could add an option to the main menu to control your TV using your voice. 

I'm not talking about small navigational things ("Right", "Pause", etc.), but 
only full, atomic operations (like playing movies and TV shows). 

To launch a TV show, you have to click several times (main menu >> show >> 
season >> episode >> play), and that doesn't count scrolling. Reducing this to 
click+talk would be much more convenient.

Original issue reported on code.google.com by Anthony....@gmail.com on 31 Jul 2010 at 3:45

GoogleCodeExporter commented 9 years ago
Here's a demo I've been messing with, to show what I'm talking about. Some 
notes:

  * The icons are just resized versions of the artist button, so they would need to be cleaned up.
  * It's disabled by default (enable it in the preferences).
  * When you search, you say the title of a movie or TV show. It will try to match it -- if it's not too confident, it will give you a list of the top 5 results and let you pick one. I arbitrarily chose thresholds for these things, so they can definitely use some tweaking.
  * If it's a movie, it plays the movie. If it's a TV show, it plays the first unwatched episode.
  * It's just a demo, so it displays a Toast with the raw output of your voice search command before it starts doing anything. This would obviously need to be removed.
  * It's probably not the cleanest code -- sorry.

Original comment by Anthony....@gmail.com on 31 Jul 2010 at 3:50

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Also, there's a bug in the way that the remote grabs the "watched" property of 
an episode. Currently, it pulls the c08 row from the episodes table, which XBMC 
doesn't populate. Instead, it needs to look at the playcount from the files 
table.

This has been changed in the patch. I just wanted to point it out, since Voice 
Control probably won't be added anytime soon, and someone else might be relying 
on this field.

Original comment by Anthony....@gmail.com on 31 Jul 2010 at 3:54

GoogleCodeExporter commented 9 years ago
Here are some screenshots:

http://bit.ly/b5MkG4
http://bit.ly/bE9tac
http://bit.ly/dxeo82
http://bit.ly/8Xi1bz

Original comment by Anthony....@gmail.com on 31 Jul 2010 at 3:58

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Sorry, here's an updated one (this replaces the patch in my first comment). 
Apparently the voice recognition will use "#####" as a result sometimes. 
Because of the logic I use when calculating edit distance, this matches all 
shows/movies that you have. I've fixed that in this patch.

This also changes some of the constant values to make it more intuitive.

Original comment by Anthony....@gmail.com on 31 Jul 2010 at 7:12

Attachments:

GoogleCodeExporter commented 9 years ago
Wow, this looks really promising! Thanks a lot for your effort I'll have a look 
at this as soon as possible. Sorry for my late answer.

Cheers!

Original comment by phree...@gmail.com on 2 Aug 2010 at 6:50

GoogleCodeExporter commented 9 years ago
Wow, that is looking awesome. What a great feature :)

Original comment by till.ess...@googlemail.com on 3 Aug 2010 at 10:27

GoogleCodeExporter commented 9 years ago
Here my first thoughts:

1. Very nice idea. Really, I love it.
2. It's a little unstable. Your comparing algorithm takes quite a while, and 
while working the app is frozen. Trying to use it will crash it. This would 
need to be put into a thread with some progress dialog showing up.
3. I wonder if we should query the user first about the keywords Google returns 
after the recording. That would make the search faster and give the user the 
possibility to retry if it was recognized wrongly.

I would be willing to open a new branch for this feature and let you fiddle on 
it, if you want. Drop me a message on IRC.

Original comment by phree...@gmail.com on 4 Aug 2010 at 8:58

GoogleCodeExporter commented 9 years ago
Thanks for the feedback! My biggest problem is that I have a relatively small 
library and I only connect through WiFi, so I was worried about my inability to 
really test performance.

I'll mess around with some different things. I like the idea of picking one of 
the words that the user said. I arbitrarily chose the "top 10 words." If the 
compare algorithm is the bottleneck, making this 5 or less would cut that in 
half.

I'll look into this much more. Thanks for the feedback -- I'll add a bunch of 
fake library entries and connect over 3G for better testing.

Original comment by Anthony....@gmail.com on 5 Aug 2010 at 12:29

GoogleCodeExporter commented 9 years ago
I don't think the connection is the bottleneck, so you can assume that you have 
a WiFi connection.

Original comment by phree...@gmail.com on 5 Aug 2010 at 6:14

GoogleCodeExporter commented 9 years ago
Here's another update to the patch (it should be against trunk). I've changed 
some of the constants (primarily, I reduced the voice results down to one, 
although I might need to increase that in the future). I've also added a 
progress dialog that changes messages, so we can see where the lag is coming 
from. The messages are (in order):

  1. Fetching TV shows... (downloading a list of shows from XBMC)
  2. Processing TV shows... (running the compare algorithm)
  3. Fetching movies... (downloading a list of movies from XBMC)
  4. Processing movies... (running the compare algorithm)
  5. Processing candidates... (just going to a different method)
  6. Processing top candidates... (getting the top 5 results from the TreeMap to present to the user)

For me, fetching takes by far the most time; however, the entire search doesn't 
take very long. For my phone/HTPC, these changes seemed to make an improvement. 
I could really use some more testing, though. Can you guys try it and let me 
know how long it takes for you?

(of course, this is still very experimental...for example, canceling the 
progress dialog only closes the dialog -- it doesn't stop the process from 
finishing. I still need to wrap it up into a separate thread)

Original comment by Anthony....@gmail.com on 13 Aug 2010 at 3:57

Attachments:

GoogleCodeExporter commented 9 years ago
Cheers!
Will test when I get back home. You sure you don't want to work on your private 
branch? :)

Original comment by phree...@gmail.com on 16 Aug 2010 at 8:56

GoogleCodeExporter commented 9 years ago
If you don't mind making a private branch for this, I'm definitely not opposed 
to it. :) There's a good chance I'll have to tweak a bunch of constants, and 
the patches are already starting to pile up.

Original comment by Anthony....@gmail.com on 16 Aug 2010 at 5:22

GoogleCodeExporter commented 9 years ago
Anthony, I've built a version with your code to play a little bit with it, but 
unfortunately I'm receiving the "Voice control not supported" message. Do I 
need something enabled on my phone on OS level or it should work out of the 
box? The device is a Samsung Spica with android 2.1

Original comment by Gabor.Fo...@gmail.com on 7 Sep 2010 at 11:58

GoogleCodeExporter commented 9 years ago
It should work as long as you have an app that provides speech recognition on 
your phone. I thought that most 2.1 phones had Google Voice Search installed by 
default, but maybe the Spica doesn't.

Maybe something like this? 
http://forum.samdroid.net/f28/google-voice-search-1944/

Original comment by Anthony....@gmail.com on 9 Sep 2010 at 12:04

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hey Anthony, will branch soon so you can do your thing. Sorry (again) for being 
such a slow arse.

Original comment by phree...@gmail.com on 9 Sep 2010 at 12:33

GoogleCodeExporter commented 9 years ago
Thanks. That's the application I was missing.

Original comment by Gabor.Fo...@gmail.com on 9 Sep 2010 at 1:02

GoogleCodeExporter commented 9 years ago
phreezie: No problem at all on the wait. I've been awful busy lately, too.

Gabor: Glad that you got it working. I've got some improvements that weren't in 
my last patch, but I'm wondering if you've run into any major issues with it?

Original comment by Anthony....@gmail.com on 10 Sep 2010 at 3:56

GoogleCodeExporter commented 9 years ago
How to install the patch....tx

Original comment by artpr...@yahoo.ca on 22 Apr 2014 at 4:10