Speech Recognizer

… To work offline, the device would need to have all of the data normally stored online, which I think is the case with Android One.

What exactly is your goal? What should your App do?

The Gboard keyboard app in offline mode downloads a database of words to the mobile to allow it to work offline. It works great on my Android 9 mobile but not Android 8 tablet, though I am unsure if it’s the Android version that is the problem as this ability has been about for a while now. I’ll dig my old standby mobile out and see what it does on that.

The app is fully working but I thought it would be nice to voice control it too, not essential and may not even work as well but nice to learn these things.

I already had my camera mounted on a tripod in the kitchen trained on bird feeders in the garden. This is remote controlled using Direct WiFi with a downloaded app that can zoom, focus and shoot. I split the screen with my app alongside it that controls stepper motors that rotate and pan a tripod mount holding the camera using an Arduino Uno board via Bluetooth. I can provide links if you’re interested but that’s basically it, a nice little project

Sorry you got a Huawei device Dave. Just to let you know, the MIT SpeechRecognizer component works very well without a WIFI connection on my Samsung Tab A. The tablet uses Speech Recognition when connected to WIFI or with WIFI turned off on the tablet.
It is an Android 8.1. How does the SpeechRecognizer component decide whether to use the online recognizer or not? I haven’t a clue. It just happens.

I suspect the Huawei is just stupid. It just might include the os software to use offline speech recognition.

For reference my Android 4.2.2 can only use SR when connected to a network or WIFI.

Thank you for your response.
Perhaps I haven’t explained it very well:-

The MIT Speech recognition works perfectly, all it does is call the device’s speech recognition service. I only asked on here in the hope someone had a similar experience and could help.

My MIT app controls motors that operate a tilt and pan mechanism that I made, which sits between the tripod head and the camera.

My camera can run an app that allows it to be remote controlled by a mobile app BUT it requires a Direct Wifi connection so disconnects from the router, meaning I have no internet access while that is active.

I run the 2 apps together in split screen mode.

The now default Android Google Gboard keyboard app can accept speech input and by default uses the Google online service. It also has the ability to work offline, if this is selected you choose your language(s) and it downloads the dictionaries to your device and will work without an internet connection. The offline option, even though selected, doesn’t work on my Android 8 Huawei tablet, it just states Network Unavailable so it seems to be trying to use the online service still. I am unsure whether the problem is with the Android version, the Gboard input or the Huawei tablet. I have contacted Google and Huawei, but I’m not holding my breath.

Many thanks for your time

UPDATE - I got my emergency mobile from the car, a Motororla Moto G5, and it has Android 8 with Gboard as the default input device and all set up to work offline. I tried voice speech with WiFi on and it works fine, turned WiFi off and it doesn’t work so it looks as though it’s the Android version rather than the device.

Hi Dave

Perhaps a combination of both. One thing not picked up on before - not every device supports split screen mode.

There is another solution to explore, a tablet running Windows 10 (owch!)

This is only for my use and it’s only feasible to run on a large screen in split screen/floating windows. I don’t intend buying a new device, though I may at some stage get a tablet with Android One.

I wouldn’t entertain a Windows tablet, though I have done some Windows CE mobile development before.

I am hoping that Huawei will stick with their original plan of rolling out Android 9 to the T5 Mediapad 10, I have asked but we will see.

That sounds onerous.
What make and model is that camera?

It’s quite common to connect a mobile device to things using a Direct WiFi connection and you can only connect to one network at a time so it disconnects from your router.

It’s a Sony DSC-HXV400V

From what I see at
https://support.d-imaging.sony.co.jp/www/cscs/pmm/page2.php?area=gb&lang=en&mdl=DSC-HX400V&abil=31100&mode=connect
there are also NFC and QR code connect options.

They are just means of initiating the direct WiFi connection the first time. I don’t have NFC so I used the QR code, but it remembers them after that.

TBH the speech control isn’t as quick or easy as the ball on canvas and edge collided option, which I have working great now. It would have been cool to have got speech working though.

The only slight issue I have is that I’m sure when I first tried edge collided when dragging the event was triggered when the edge of the ball touched the canvas edge but now it’s where my finger is, which is the centre of the ball, weird.

I have you to thank for that idea by the way, so many thanks. It’s nice to use a forum where people take the time to help

Hi Dave

That was actually an enhancement in the latest release :innocent: It brings the ball into line with typical game math code and so easier to understand from that perspective.
You could, instead of a built-in Ball, use your own Sprite.

Edit: Given Steve's test on his Android 8.1 Tablet, it looks as though the Huawei Tablet might not deliver the offline ability you require, even after the update -you should be able to update it to Android v8.1 while waiting for Android v9. Since you are filming bird feeders, the least noise the better? "Our" birds fly away if we make a sound in the kitchen.......

What's the state of the CenterAtOrigin property? It should be false by default, which should not interfere with the old collision behavior. Do you think you can produce an example app that shows the behavior difference between the two versions?

Many thanks again for a prompt response,

The CenterAtOrigin property is checked; I only started trying the ball on canvas option 5 days ago so I didn’t realise it was a recent option.
I only use the ball on canvas like a finger pad/joystick so don’t animate it in any way, but I was fairly sure that when I dragged the ball the .EdgeReached event triggered when the outer edge of the ball reached the edge of the canvas but I may have been dreaming, is that is what is supposed to happen?
It isn’t being triggered until my finger reaches the edge. I have made the ball and canvas small and it is quite usable and I only want to move my finger a small amount anyway, but it would be better if it worked as I thought it did. I will upload an image of my blocks

Many thanks for your input,

Ball - See response to ewpatton.

SpeechRecognition - See my previous reply clarifying this, which concludes that the issue is with Gboard and the Android version. If Huawei release an upgrade to Android 9 we will see, but as I said in previous reply I don’t think controlling my App with speech is as efficient as ball on canvas finger pad/joystick, but I like to try all options :slight_smile:

Hmmm, just got rid of what was on Screen1 as I am definitely going to be using ball on canvas rather than buttons.
I created a label, canvas and ball with centreorigin checked and events for dragged and edgereached and it woks as expected - on my mobile.

I have a hunch - I am using the app on my tablet in split screen mode, using 1/4 of the screen. The ball moves OK but I’m wondering whether this is affecting the position. I will have an experiment with sizes, using pixels, percentage, automatic etc. and report back

UPDATE and apologies for wasting your time, it’s the timer that’s causing it so I need to sort that

No worries. I'm glad you were able to identify the underlying problem.

Okay! I have this working acceptably well but more by luck than judgement and I like to understand what I’m doing.
I have created a simple ball on canvas with timer, so it now looks like the image. If I don’t use the timer it works as expected BUT it is way too fast for me to control my stepper motors so I need to introduce a Timer. Incidentally if I add TexttoSpeech and speak the counter number it slows it down to a decent level BUT I don’t want that :slight_smile:

If I replace the call do_stuff at the bottom of the edgereached event with timer.enabled = true edgereached carries on in the background with the do_stuff procedure getting triggered erratically. I have tried changing the timer interval from 100 to 2000 and it makes little difference.

I have also realised that the touchup event of the ball doesn’t get triggered if I move my finger past the outer edge of the button, which is understandable.

So the bottom line is, am I missing something simple here and is there a better way to do it as it’s a nice intuitive way to control my motors? I am new to this and loving the capabilities.

This is the Design screen BTW:-

Dear Dave,
maybe I’m coming on this topic too late and you have already solved your problem.
Anyway, since I’ve had the same, and I’ve been able to solve it, I would share how I did (at least, how it works for me :-)).

I have developed a digital dashboard for my old convertible car and I wanted to give voice commands like a hands on display, and w/o internet connection (off-line use).

I have used Puravida (thanks to Taifun !!!) extension so to have the speech recognizer always working without the need to hold down a button while speaking, and in off-line mode.

It was working perfecty on a Samsung and a Xiaomi phones, but on a chinese, low cost tablet, it was always giving me “server error”. The problem was due to the fact that the language (Italian) was not available as an off-line language, in the “voice input” settings of the tablet.

Luckily on the tablet the list of “possible” languages was comprehensive of the Italian, among others, so I just downloaded it from the web and it became available in the list of usable ones. Everything is feasible just by using the voice-off-line-configuration menu of the tablet (or phone).
As soon as loaded, the tablet has started to understand my speech.

Maybe this is not your case, if your mother tongue is English and the voice recognition works already with English language, but it might be helpful for other nationalities AI2 users.

Stay healthy :hugs:

A post was split to a new topic: SpeechRecognizer to phone people in my contact List