Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

[Android] Speechcontrol EGSpeech

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
timothy3001
Posts: 6
Joined: Thu Jul 19, 2012 7:13 pm

[Android] Speechcontrol EGSpeech

Post by timothy3001 »

Hey folks,
i just finished an alpha version of one of my first apps for the android platform. it is called "Homecontrol" or in german "Haussteuerung". It works very easy: when you open it, you speak your command and it will be sent to the Broadcaster plugin of eventghost on udp port 33333. Well, as i already said before, it's just an alpha version so you have to do some things manually, e. g. the setup. In addition you cannot use a different port because i didnt implement it yet^^, but we will see...

The setup:
1. Open the app once and press cancel.
2. get or start a file explorer which has got a text editor like "total commander" (for free in play store)
3. On your external storage (i hate this description because for me it is an internal storage) and find the file "HSettings.dat" or "HSSettings.dat" and start it with your editor

4. ok, now in this data you'll find in the first line (it's important that is stays there^^) something like "a:xp-server". you have to replace "xp-server" with your server address(i think a name and also an ipadress will work), BUT DON'T use spaces!!

5. after that you see several lines that are build up like this: "c:alle Rolläden hochfahren: alleRollaedenHoch"; well thats german and in english it means "all shutters up". This is the part where you will edit the commands that can be recognized by the app and also you can say which command will be sent to EG: "c:Command that you speak:CommandThatWillBeSent". As you can see in the examples i used several Strings that are sent to EG more than once;That's just because of different choices of words.
You can delete my examples and add your commands. BUT AGAIN!!!!!: Be careful with spaces: they are forbidden right before and after the ":".

HINT: To find out what the "spoken" command is, just open the app and speak your command. There will appear a little message which contains what you said.

(6. for those who are new to eventghost: add the broadcast plugin, test your new command and see if the command reaches EG. Then you can use the Event for whatever :) )

-I hope you like it and pls pls pls send me suggestion, report bugs and so on. I am sorry that i just implemented 2 languages so far, but the problem is, that it is a lot of work to add new languages and as you can see below, i had to compile two different .apk's for 2 languages. ("Haussteuerung.apk" = german; "Homecontrol" = English)

- The "main concept" (if you can already call it sth like this :D ) is to have little, simple and fast app. So if you want me to add something like a config button for the settings: nope, i probable won't. BUT: i wanted to create a 2. app in the future to edit that file. I know it's not nice to have 2 apps for 1 thing but it'S not easy to edit that window for the speech recognition.

So all in all i hope you like it and if it works well and is in fact useful (i mean i do use it :D because i think it's in fact very handy, but maybe you think differently about it) i will improve it and i think i will also buy a license for the play store to upload the apps there.

In addition i hope there isn't already another app for this^^ and if so pls send me the link :P

Greetz Timo

PS: If you want to cancel the app, just say "cancel" or in german "abbruch";


Update(22.07.12): Improved recognization of commands.
Update(18.08.12): Now only available in Google Play: https://play.google.com/store/apps/deta ... speechfree and with settings menu. There will be an unlimited version soon.
Last edited by timothy3001 on Sat Aug 18, 2012 4:18 pm, edited 2 times in total.
Owel
Posts: 41
Joined: Thu May 31, 2012 5:51 am

Re: [Android] Speechcontrol

Post by Owel »

Hey, great idea.
I will test it :)

I'm German too, so deutsch is pretty handy ;)

once i tested it, i will give feedback.

Owel

PS: is this app available in playstore?

PPS: it's more comfortable if you edit the config file from a pc :P
Owel
Posts: 41
Joined: Thu May 31, 2012 5:51 am

Re: [Android] Speechcontrol

Post by Owel »

Hi, I installed your App.
But as far as I can say, it does not understand me!
I tried your example, it didnt get it.
I also tried a simpel command "lauter". it got "leo.org" wtf?

Sry man, this alpha isn't usable

Owel
timothy3001
Posts: 6
Joined: Thu Jul 19, 2012 7:13 pm

Re: [Android] Speechcontrol

Post by timothy3001 »

Hi,
i had similar problems but with "licht". it always recognized "nicht". The problem is, that the google speech engine(that's what i guess) works with contexts. I also had problems with "lampe draußen". every time it understood "lampe kaufen"" or "lampe tauschen", because it makes more sense. You cannot modify it much, but at least a little^^ and that's what i tried. For me it worked a lot better since then.I also tried "lauter", and often it works but sometimes it recognizes "router".Moreover, google seams to have problems with one word commands. well, just try it and tell me pls if it's working properly now

it's not yet available in the play store because it's one of my first apps and ididnt buy a license yet. and because of editing the settings file: yea u're right, it's really annoying but you can edit it on the pc.

PS: "musik lauter" and "ton lauter" work definitely.
timothy3001
Posts: 6
Joined: Thu Jul 19, 2012 7:13 pm

Re: [Android] Speechcontrol EGSpeech

Post by timothy3001 »

New version available in the Google Play Store. Now with Settings Menu. Just say "Settings" or in the german version "Einstellungen". There you can specify the server's ip and the commands. At the moment there is only a free version with only 5 commands available, but when i have my credit card, i gonna add a paid version which will cost around 0,70Ôé¼ and has got unlimited commands.

please test it and tell me about errors and bugs and stuff like that and tell me how i can improve it.

Thanks in advance, Timo
Diabl0570
Posts: 30
Joined: Sun Feb 28, 2010 6:05 pm

Re: [Android] Speechcontrol EGSpeech

Post by Diabl0570 »

very nice concept. i'm playing with it now. for simple commands this program is great.

My feature request list, if i may :lol:
Option for payloads(payloads load from a list maybe xml or csv. That way its easy editable with any computer for easy adding large lists for example an movie list, or music list)
Option to broadcast to other pc programs as well (especially VoxCommando)(Don't know if possible but its also a voice control app)

any way, thanks for your application.
timothy3001
Posts: 6
Joined: Thu Jul 19, 2012 7:13 pm

Re: [Android] Speechcontrol EGSpeech

Post by timothy3001 »

Thanks for the feedback.

i think it's a good idea to use table files. but there is a problem: it would be possible to save all the commands in ONE file. That's no problem, but it gets difficult if you try to use more than one table file. because at the moment i load the data from a file and only the lines which begin with "c:" are loaded. you can check the HSSettings.dat in the root of your internal memory (card). and after that, i save all the loaded commands(so basically every one which starts with "c:") back in that file + the server settings (wihch start with "a:").

So what I want to say is, i have 3 opportunities for you:
- it is possible to use several table files (preferably .csv's) but then you couldn't edit them with the internal editor of the app.
- if you dont have a problem with putting files together, i could let the app "bake" all files to one. But then it would be difficult to split them again. yet i could add kind of marks, so you would see them if you look at the whole file. (i will see if i can use these marks also to cut the files)
- the third opportunity (and i think it's the best) to use one file, which will be loaded in the setting menu, and which is editable from within the app. but all the other files are also loaded into the speech recognition, but arent editable.

So as you can see i dont have much experience with things like that :D but at the moment i don't have another idea that fits into the plenty of my skill^^.

And because of VoxCommando: i'm not sure if it's possible, but i will see if there is a chance to communicate with that program.

PS: I try to find a better way than those above.

Greets Timo
Diabl0570
Posts: 30
Joined: Sun Feb 28, 2010 6:05 pm

Re: [Android] Speechcontrol EGSpeech

Post by Diabl0570 »

Hi Timo,

One big config file included events, payloads and actions, is fine with me if that is easier for you.

But i think xml seems the best bet, since it has an hierarchical structure. There are simple frameworks for java like: http://simple.sourceforge.net/, for reading / writing xml files.

the idea behind this was to be able to easily edit the file with pc for large amount of payloads.

are you still working on this project?

Greetings


EDIT
Never mind just saw the update. csv is fine for now ^_^
Thanks mate
Diabl0570
Posts: 30
Joined: Sun Feb 28, 2010 6:05 pm

Re: [Android] Speechcontrol EGSpeech

Post by Diabl0570 »

Hi,

I made an little javascript tool to easily add commands and generate the config code.
I made this with the idea in mind that i want to be able to approach one action with different voice commands.
for example:
  • Volume up
    Play louder
    Increase volume
    Turn the volume up
    Turn up the value
    ect.
instead of creating an new entry for all the different voice commands, you insert the eventghost commando once and can list the voice commands.
website:
http://sterkestroming.nl/egSpeech/
if anyone is interested in an decoded non-minified version send me an pm.

HTML, css and javascript are all included in the file so, if you prefer to you can copy the source code from the website and past in in an .html file ( i can not upload the html file as an attachment because of security)


edit:
and if it was not clear to you, you have to add the generated code to the config file of EGSpech located at your sd-card.
timothy3001
Posts: 6
Joined: Thu Jul 19, 2012 7:13 pm

Re: [Android] Speechcontrol EGSpeech

Post by timothy3001 »

Hi,

thank you, that really helps a lot. and concerning to the .csv file format i wanted to add sth. i encountered a problem when i wanted to load that file into excel. special characters like ├ñ ├ ├╝, which u have in germany for example are displayed wrongly and that's because excel uses (at least here in germany) the ascii format, but android uses utf-8 as far as is know. so it could be, that u have to convert it via the editor for example. there u can say in which format it should be saved. and apart from that i'm not sure if i'm using the .csv file correctly, because i use ";" to seperate the fields but i have heard, that somehow "," is possible too or needed.

so if u have problems with that or sth else, pls report me :) .

P.S.: as u might have seen, i updated the user interface, tell me pls if u like it or if i should change sth.

greets timo
Diabl0570
Posts: 30
Joined: Sun Feb 28, 2010 6:05 pm

Re: [Android] Speechcontrol EGSpeech

Post by Diabl0570 »

Hi,

i don't exacly know what charset encoding Excel and Android uses, but i think you could encode the data into another charset.
I search the internet for a while and found an charset encoder for android on the official android developers site:
Transforms a sequence of 16-bit Java characters to a byte sequence in some encoding.
http://developer.android.com/reference/ ... ,%20float)
another site that may be use full
http://stackoverflow.com/questions/1149 ... -java?rq=1


csv files in europe and some other continents/countries don't use comma's to separate the values.That's because in the US they write numbers with an dot ($1.50 or pi = 3.14159) while we write numbers with an comma (Ôé¼1,50 or pi = 3,14159). because of that comma is an realy bad separator,so we use an ; for csv as default. so ; is preferable, besides that in excel you can choose with separator to use.

The interface sure looks nicer.
but i personal would choose an much more clean interface something like so:
https://docs.google.com/drawings/d/1epG ... K9q5U/edit

Greetings
Kasper
timothy3001
Posts: 6
Joined: Thu Jul 19, 2012 7:13 pm

Re: [Android] Speechcontrol EGSpeech

Post by timothy3001 »

Hi,

well you possibly have already seen it: a new version is out. now you are able to store for each sent command several spoken commands, which makes it easier to handle all possible spoken commands. Therefor there is also a new user interface which is much cleaner and easier to use. you can also check out the video which explains how to use is it now.

PS: I'm sorry if you had problems with the last version and if you couldn't save your changes. It should be working now.

Both version (the normal and the free one) are updated now. In the free version you can use only 2 sent commands now, but infinite spoken commands.

Here are links once again:
EGSpeech: http://play.google.com/store/apps/detai ... m.egspeech
EGSpeech Free: http://play.google.com/store/apps/detai ... speechfree

Greetings Timo
Post Reply