Newbie Speech Issue (select number to call with SpeechRecognizer and then call Direct automatically)

Sometimes things are not so obvious. I'm attempting a 'dumb-by-voice' calling program for my nearly blind mother-in-law on Android. I have given the MIT App on the phone permission to use the microphone but it does not show any text. As a test, when I switch on Voice Access then both the Google text output works and so does the MIT App text box I deliver the speech to. Obviously, I don't want Voice Access on since she could get herself into all sorts of bother.

My demo app is simple and just delivers the spoken text to a viewable text box. Nothing more.
Any clues? Feels like something silly/or obvious.

Explain what it is you are trying to do ?

I can't get my demo boot-strapped, so to speak, since the voice recognition does not appear to action if the Google Voice Access is not enabled. It's just a simple .AfterGettingText result pushed into a Text box. I'll be doing lots of other things when I can actually read any voice input.

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Here's the one and only block.

You need to call this method from a button (or similar) to invoke the speechRecogniser:

image

You also need to tell it to stop!

image

Have you read and tested the example app that is part of this tutorial mentioned below?

It does not exactly do all you want to do but the experimental app might be part of what you hope to do by making a program that will initiate (start a phone call to a particular number using her voice and the Phone component MakePhoneCallDirect()
directly initiates a phone call using the number in the PhoneNumber property, bypassing user interaction to start the call.

Is something like this what you want to do Martin?

I'm afraid that's not my experience. If Voice Access is running, the SpeechRecognizer block is activated and shows the same text.

Don't know what Voice Access is, in terms of AppInventor, is this a device specific process ?

I have seen the tutorial. None of it mentions how to put the phone in a correct state that will cause the SpeechRecognizer to action. I would probably take more interest in it once I have the initial condition triggered. I just wanted to see the most simple example possible work.

It's the Google system app that allows Android to be voice controlled. I don't want this level of complexity.

Step back. How do you propose to start the app ?

I would have it as the home screen - so always running.

That is true. The app shows how to do something. Making the phone call using the Phone toll is doing something.

You read about the SpeechRecognizer being used to do something useful. Making the phone connection . To do this you will need to use Companion 2.77u that exposes the MakePhoneCallDirect() block available.

This would need to be coded to possibly run in the Background using Itoo or another method so the app is always running. I don't necessarily think you need to do that if she is capable of turning on the basic app she needs only when she needs it. The example shows several ways to use the SpeechRecognizer. :wink:

Again, I have no use for anything else if the speech recognition is not activated when the app starts. Do I have to make this a standalone app before it will recognise the microphone? As it stands it does nothing and I cannot move forward. I have already used the phone library to make calls but the app was still not dumb enough since it needed a finger and not just voice.

probably because you probably used the MakePhoneCall Block instead of the MakePhoneCallDirect block.

I got a version of Parrot to start with a voice message "Call Martin without" intervention so the user knows the app is working.

The user says "call Martin" using the SpeechRegonizer ; thee app then loads Martin's phone number and dials his phone

His phone rings. If he answers she will be in phone contact with him.

:grinning:

Actually I think this can be done with a single phone number without using the SR; just loading the app would make the phone call, with a Clock or possibly without one.

You can activate it in the Screen1.Initialize event by using the GetText method

From the documentation Media

GetText()
Asks the user to speak, and converts the speech to text. Signals the AfterGettingText event when the result is available

What about examining @SteveJG 's example app how he did it?

Taifun

1 Like

In the GetText() method, I would suggest the description is somewhat confusing. It says "Asks the user to speak" - I did not want that. If it's action is as you say then "Initiates wait condition - use this as first step" or something similar. Looking at the sequence of command blocks when SpeechRecognizer is dropped in makes little sense, since the initialisation and pre-sets are jumbled up. I will, of course, look at the examples more closely now I know how easy it is to be confused.

Thanks Steve. I will examine your examples more closely.

As to my mother-in-laws capability, she can see the phone itself (on a desk, say!) and feel the buttons on the side but actioning any app is almost impossible - so firing up the Phone app and scrolling is not on. My prime aim is to allow her to call a set of contacts from a simple list which I will store on her phone and load when the app starts. That means the app must always be front and centre and have no physical active components and be in a wait loop. Meanwhile, I will be attempting to use wifi calling via her Google Mini - but I hold little hope of success. Virtually every 'senior' phone in the market assume you can here and understand commands from a 'normal' phone interface. Her increasing dementia means she is only capable of saying "Call XXXX". Such is life.