Voice activation

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

Voice activation

Post by anmldr » Sun May 09, 2021 5:09 pm

Looking for guidance about sounds and LiveCode. For instance, is voice activation possible? Example, if my app is running and I say something, can the app send out a “beep” to show that it can respond. If this is possible, is there a way for a LC app to, usually, distinguish between voices vs other sounds?

I just dreamed up an app but do not want to start working on it if this is not possible with LC. Pointers to documentation would help if it is available. I cannot seem to find anything in the dictionary.

Linda

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Voice activation

Post by dunbarx » Mon May 10, 2021 4:32 am

Hi.

I have never done this, but check out Monte's "Merg" gadgets in the dictionary, especially the "mergMicrophoneStartRecording" command.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Voice activation

Post by FourthWorld » Mon May 10, 2021 7:15 am

Voice recognition is complex stuff, usually handled by OS services. Most such mechanisms provide a way for developers to integrate voice support into their apps, sometimes with low-level APIs that would require LiveCode Builder to use, sometimes through resources definable at a higher level to register phrases to be recognized and response triggers.

I haven't looked deeply into it myself, so that's as much as I know.

Just seemed worth confirming that it is indeed a non-trivial task in any language, and not just technically but also ethically:

In order to be able to respond to commands directed to the device, the device must listen to EVERYTHING. At all times. And some of that gets sent to the OS vendor for processing to determine if indeed the device was being invoked.

Most voice service providers have a place in your account settings where you can review everything they've recorded. I found it super creepy.

I used to not think about such things, happily enjoying voice control. But after reviewing the snippets of conversations picked up from my home, office, restaurants, and anywhere else I'd been, I'm no longer comfortable having an always-on microphone connected to the Internet.

I've turned off all such services, deleted the recordings, and never looked back.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

Re: Voice activation

Post by anmldr » Mon May 10, 2021 5:25 pm

That is creepy. No, I do not want to record anything. I would even make sure that the app only responds if it is running in the foreground.

It would be an app that wakes the user up if they are talking in their sleep. Sometimes...I also sleepwalk and that is extremely dangerous. Sleep walking, for me, is always proceeded by sleep talking.

I was hoping to distinguish between voice and other noises so that the user would not be woken up just because there was some other noise occurring.

If the complicated part is determining if it is a voice or something else then, what about the app responding if a noise continues for, say, 10 seconds?

Linda

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Voice activation

Post by FourthWorld » Tue May 11, 2021 6:38 pm

anmldr wrote:
Mon May 10, 2021 5:25 pm
That is creepy. No, I do not want to record anything.
Periodic recording of ambient sound to send to the OS servers for further processing isn't a choice, it's just how voice control systems work.

Your app sounds valuable. I wonder if motion detection might be a less invasive option.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

Re: Voice activation

Post by anmldr » Tue May 11, 2021 10:08 pm

Periodic recording of ambient sound to send to the OS servers for further processing isn't a choice, it's just how voice control systems work.
Thanks. I did not know that.
I wonder if motion detection might be a less invasive option.
I can’t see that working unless it is an app for the Apple watch. When I sleepwalk, I don’t reach for my phone, iPad or laptop :)

Linda

anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

Re: Voice activation

Post by anmldr » Tue May 11, 2021 10:13 pm

I have never done this, but check out Monte's "Merg" gadgets in the dictionary, especially the "mergMicrophoneStartRecording" command
.

Thanks. “Merg” is for iOS only, I think. I would want to have an Android version of the app since that is what I have for a phone. I do have an iPad too.

Linda

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Voice activation

Post by capellan » Tue May 11, 2021 10:20 pm

Could you use an Apple Airtag?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Voice activation

Post by FourthWorld » Tue May 11, 2021 10:35 pm

If adding hardware is okay, external motion detectors may be an option.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

Re: Voice activation

Post by anmldr » Tue May 11, 2021 10:56 pm

capellan wrote:
Tue May 11, 2021 10:20 pm
Could you use an Apple Airtag?
Perhaps. I could clip it to my pajamas. But, again, this is only for Apple. And, I am not sure if the motion detection info is available to anything other than the “Find My” app.
FourthWorld wrote:
Tue May 11, 2021 10:35 pm
If adding hardware is okay, external motion detectors may be an option.
Trying to understand...add the motion detection hardware to what? Do you also mean something like the Air Tag?

Even though most people would not want their voice to be recorded, the more that I think about this, I am almost sure that sleeptalkers/sleepwalkers would not care. The reason? Sleepwalking is a very serious safety issue. For me, sleepwalking is almost always proceeded by sleeptalking. It would be better to wake up BEFORE the walking occurs.

Linda

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Voice activation

Post by jacque » Wed May 12, 2021 7:11 pm

Sounds like a terrific project and a useful one. I'm not sure you can do it with LC though. Motion detection may be a workable solution. You could put a motion detector on the nightstand or somewhere where it isn't pointing at the bed but would catch movement in the surrounding area. If you use a smart detector and Google routines, you can have it only trigger between certain hours when you're sleeping, or start watching when you say the "bedtime" routine keyword. The routine could have Assistant say something at high volume, or turn on a light, or whatever else would wake you up. (You'd need a smart bulb for the light if you choose that method. Having Assistant scream at you might work better anyway.)

Unfortunately I don't think you can use speech detection with this method unless you happen to say "hey Google" in your sleep.

Edit: You're right, AirTags only report location when you monitor them yourself.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”