Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By Mmiscool
#61030 Hello,
https://youtu.be/AUpzyJm38o8



ESP Voice.zip

I am attaching a zip file with the php and javascript need to make this work. If you have a local php server just copy these files to convenient directory and navigate there in your web browser. It will ask you for permission to access your microphone.

You will have to modify the ip addresses in the msg url links in the php file to match the ip of your local esp device.

You can also add more commands pretty easy.



I am using the following code from the MSG URL (Advanced) demo on espbasic.com
https://www.esp8266basic.com/msg-url-advanced.html
Code: Select allmsgbranch [mybranch]
print "You can send msgs to the esp and do things based on accessing a URL"
wait
[mybranch]
MyReturnMsg = "Not a valid msg received"
pinNo = val(msgget("pin"))
pinStatus = val(msgget("stat"))
pinAction = msgget("action")

if pinAction == "po" then
   io(po,pinNo,pinStatus)
   MyReturnMsg = "good"
end if
if pinAction == "pi" then
   MyReturnMsg = io(pi,pinNo)
end if
if pinAction == "pwo" then
   io(pwo,pinNo,pinStatus)
   MyReturnMsg = "good"
end if
if pinAction == "pwi" then
   MyReturnMsg = io(pwi,pinNo)
end if
if pinAction == "ai" then
   MyReturnMsg = io(ai)
end if
print "DOne with retrn code"
msgreturn MyReturnMsg
wait
You do not have the required permissions to view the files attached to this post.
User avatar
By forlotto
#61067 Most excellent I already have voice running in a similar manner without having to host any website so to speak but... It costs about 5.00 for the applications for each device to do so.

This essentially makes it free but there are caveats you say with mobile what ever these are exactly I would assume this would be the go to method for microphones low power devices I could not see running a PC and shelling out all kinds da munies for electricity if that was the case I'd likely have a PF sense setup with 10GBE as well. Possibly something like intel compute stick or another lower powered PC would do the trick.

Ultimately I would like to integrate alexa or google home speakers seem low power enough to do the trick with far field microphones. However why add the extra expense and hassle when a phone does just as well even better at around the same price same overhead and possible a few extra bucks in paid applications I am really trying to weigh my options.

I could easily run a server low powered to do this on a pi or something I suppose that would do just fine with a bluetooh microphone low powered rechargeable hrmmmm... Definately worth looking into the only issue is the method I use has advantages with tasker and autovoice as it integrates with google now just saying OK Google "unlock door" gives me the keys to my kingdom and ok google "lights medium" sets my lights at a medium dim now if there were a better way to have my home full of microphones than to just carry one with me without having to wire them in everywhere like a spy or something I think I would opt for that like google home or alexa integration with espbasic msg branch example would be excellent!

As it stands right now you are saying you would have to open a browser navigate to a link then give it permission to access your microphone before you could give a voice command during that time I think I would rather just hit a button. The concept itself is nice and the knowledge to see the ability is there is cool but as soon as you need physical interaction of more that just talking into the device there is little advantage.

Now it may be possible to have a link or shortcut to open and automatically allow mic access to this page that is a step in the right direction for me it is a matter of saying OK google "do whatever" if I have winter gloves on this saves me from having to take my gloves off open an application navigate to the button I need to do what I want. I think alexa and google home finally understand this. Now it is possible to do what you want still if you can use Tasker and autovoice still and this would customize my command like so:

OK google Open Smart Webpage (opens chrome navigates to webpage and allows mic access)
From there I could say Computer ( do whatever )

How would this be useful well tasker would consume less resources on my phone so it would allow for more control of more things all integrated into the web page at the cost of speaking one extra command and it would allow personalizing to call it JARVIS or DumbDumb or whatever I wanted it to be called.

I am curious if this things are possible?

In particular auto accept microphone access and open web link via tasker and chrome haven't checked yet but possibly I could just create a single app that will display the webpage via MIT app inventor providing it does not block things like microphone access or navigation away from the web page etc..

Love the example though most excellent. May have to give it a shot here in the future just to see how it handles as it may be the better way over all. Be cool if tasker and autovoice was free for IOT or there was a free version without limitations.
User avatar
By Mmiscool
#61069 You only need to give the browser permision once. After that it rembers.