Post by mmiscool on Feb 22, 2013 22:01:03 GMT -5
Hello
I have been doing some home automation work and one thing I wanted was to control things in my home using voice recognition.
I was able to fill this goal by developing an app for my android phone that exploits googles voice recognition technology and the run basic server to control lights, fans and other things in my home.
I have a video that better enplanes some of this.
I will be posting the link for the app in the google play store but it takes a couple of hours for it to be published in the indexes so stay tuned.
play.google.com/store/apps/developer?id=app+awesomesoft
It is called "RB Voice"
The code for the run basic server is as follows.
Keep in mind this project must be published
You can add commands that it will respond to by adding more options in the case statement. This example is a basic note taking application but can be added to to make it do any thing from running a program to running another RB Application.
In the app on the phone to set it up all you have to do is hit the change home url button.
Enter the url for the published application you just made with a & on the end of it as shown below.
http://localhost/seaside/go/runbasicpersonal?app=VoiceActive&
Replace "localhost" with your servers ip addres or domain and replace "VoiceActivate" with the name of the published project on the rb server.
be sure to keep the "&" symbol on the end otherwise you will be returned an error.
The key code feild is the username and can be useful for assiging permissions on the system. It is able to identify the device issuing the command to the system on the RB side of thingd
I have been doing some home automation work and one thing I wanted was to control things in my home using voice recognition.
I was able to fill this goal by developing an app for my android phone that exploits googles voice recognition technology and the run basic server to control lights, fans and other things in my home.
I have a video that better enplanes some of this.
I will be posting the link for the app in the google play store but it takes a couple of hours for it to be published in the indexes so stay tuned.
play.google.com/store/apps/developer?id=app+awesomesoft
It is called "RB Voice"
The code for the run basic server is as follows.
Keep in mind this project must be published
You can add commands that it will respond to by adding more options in the case statement. This example is a basic note taking application but can be added to to make it do any thing from running a program to running another RB Application.
app.usr$ = mid$(UrlKeys$ ,1+INSTR(UrlKeys$, "$"))
prodject.username$ = app.name$
app.name$ = mid$(UrlKeys$ ,1+INSTR(UrlKeys$, "&"))
app.name$ = left$(app.name$ ,INSTR(app.name$, "$")-1)
GLOBAL Command.in$
Command.in$ = upper$(ReplaceString$("%20"," ",app.name$,"all",0))
print app.usr$
print Command.in$
select case 1
case check.command("new note")
open "Notes.txt" for append as #mike
print #mike, right$(Command.in$, len(Command.in$)-len("NOTE NEW"))
close #mike
case check.command("show notes")
open "Notes.txt" for input as #f
while not(eof(#f))
x = x + 1
line input #f, a$
print x;" - :";a$
wend
close #f
case check.command("delete note number")
open "Notes.txt" for input as #f
while not(eof(#f))
x = x + 1
line input #f, a$
if str$(x) <> word$(Command.in$,4) then
output.a$ = output.a$ ;a$;chr$(13)
end if
wend
close #f
output.a$ = left$(output.a$,len(output.a$)-1)
open "SMBI-OS\users\";prodject.username$;"\UserFiles\Notes.txt" for output as #mike
print #mike, output.a$
close #mike
wait
end select
end
FUNCTION check.command(command$)
if upper$(command$) = left$(Command.in$, len(command$)) then check.command = 1
end function
In the app on the phone to set it up all you have to do is hit the change home url button.
Enter the url for the published application you just made with a & on the end of it as shown below.
http://localhost/seaside/go/runbasicpersonal?app=VoiceActive&
Replace "localhost" with your servers ip addres or domain and replace "VoiceActivate" with the name of the published project on the rb server.
be sure to keep the "&" symbol on the end otherwise you will be returned an error.
The key code feild is the username and can be useful for assiging permissions on the system. It is able to identify the device issuing the command to the system on the RB side of thingd