Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 06 Dec 2016, 02:04
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Voice Control - New Pet for any Pup V3 - Feb 2016
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [9 Posts]  
Author Message
ETP


Joined: 19 Oct 2010
Posts: 908
Location: UK

PostPosted: Sun 20 Sep 2015, 12:09    Post subject:  Voice Control - New Pet for any Pup V3 - Feb 2016
Subject description: ( N+0=N )
 

.
Background Notes: for Version 1 (Sept 2015)

Voice control implementation is usually a complex mass of scripts, dependencies, python and fuzzy logic to make sense of what the speech API may return.
If using Google voice search it can swiftly become something of a nightmare.

This pet whilst still using Google Voice Search, is an attempt to simplify matters by using voice search in a different way and utilises a single bash script plus numbered “launchers”.

A major problem with Google Voice Search from the perspective of voice control, is the variety of stuff it can return when you say a word or ask a question.
There is however one area where it excels and returns consistent results - Mathematics.

If for example you ask “What is six plus four” , it will reply with 6+4=10 and that fact will be displayed and spoken out aloud.
Recognition in this feature is about 99% and even Google are not likely to change the laws of mathematics.!

This pet makes use of this ability to launch numbered scripts.

Suppose you wish to launch script 20
When the red microphone appears on screen together with the instruction “Speak now” all you need say to trigger that script is:

TWENTY PLUS ZERO

For script number 31 you would just need to say:

THIRTY ONE PLUS ZERO

Prerequisites:

Active Internet connection

Google-Chrome ( With working voice search. “O/K Google” not required)

VLC

xdotool (32 & 64-bit versions in download folder if not available via PPM)

xclip (In most Pups - check with pfind)

Xclipboard (In most Pups - check with pfind - Disable any other running clipboard)

Launcher Scripts:

O.O.T.B. the pet contains 7 numbered launcher scripts ( 20, 30, 31, 32, 60, 61, 62)
These serve as both examples and templates. Pick the one that most resembles your needs, save it as a new number, then edit it to launch the app/script/url of your choice.
Each new launcher script that you create can perform any action you wish the only limit being your imagination.

The Front-End Menu: (vcmenu.txt)

This is a simple text file whose sole purpose is to act as a reminder as to what action you have assigned to any particular numbered launcher script.
It is the intention that you edit it to suit your particular needs.
You might for example have a collection of 50 ripped audio CDs that you wish to call up by voice. If so you would list the numbers assigned and their titles.

Where to get the Pet & what it contains:

https://drive.google.com/folderview?id=0B_iVVJCd9q09aEdqY0oxVWh2STg&usp=sharing



Most of the pet’s 31 MB is taken up by the 3 webm & wav sample files.
A choice of 3 microphone icons.
Seven launcher scripts - some contain commented out alternative examples.
The main bash script vcfront_end
The menu file vcmenu.txt

Setup Procedure:

1. Check that you have Google Voice search working & that the prerequisites are met.

2. Install the pet.

3. Drag the .desktop file onto the desktop. Assign it the “Pause” key as the keyboard shortcut. Edit the text & change the icon if you wish.

4. Press the “Pause” key. Ignore “O/K Google” if enabled. Wait for the red microphone to appear and the instruction “Speak now”.
image-2.png
 Description   Simple text menu - edit as you desire
 Filesize   83.91 KB
 Viewed   822 Time(s)

image-2.png


_________________
Regards ETP



Kennels

Last edited by ETP on Thu 04 Feb 2016, 10:39; edited 9 times in total
Back to top
View user's profile Send private message 
ETP


Joined: 19 Oct 2010
Posts: 908
Location: UK

PostPosted: Sun 20 Sep 2015, 12:13    Post subject: Houston we have Voice Control - Pet for any Pup.  

.
Reserved for Additional info, tips & FAQ:

Q&A:

Q. Can I use Chromium instead of Google Chrome?

A. Yes. In the vcfront_end script just change the single reference to google-chrome on line 8 to chromium

Q. Why the requirement for VLC?

A. Two of the examples use it but more importantly VLC is due to get the CLI ability to cast to a Chromecast dongle and possibly to any DLNA renderer such as a smart TV.
Casting to such a device by voice will then be possible with a suitable numbered launcher script for each movie that you have on disc.

Q. Is the front-end menu really needed?

A. No. If you prefer to stick a big list on your wall the relevant lines in the main script can be edited so that the pause key will take you straight to Google Voice Search.

Q. Can the period that the menu is displayed be changed?

A. Yes. By default it is set to 15 seconds in line 9 of vcfront_end.
I would recommend a minimum of 1 second with no upper limit on the maximum. Setting it to 1 or 1.5 seconds will speed things up considerably
whilst still providing a quick glimpse of the menu options.

Q. Can the "Endgame" in launcher number 60 be used as a voice activated screensaver?

A: Yes. Comment out all the existing lines in 60 then add the following line:
Code:
vlc --fullscreen --loop /root/noob/files/blue_ss.webm &

_________________
Regards ETP



Kennels

Last edited by ETP on Tue 13 Oct 2015, 03:10; edited 2 times in total
Back to top
View user's profile Send private message 
gcmartin

Joined: 14 Oct 2005
Posts: 6731
Location: Earth

PostPosted: Sun 20 Sep 2015, 16:27    Post subject:  

Thanks. You are advancing PUP from the back-room/family-room/home-office to the armchair laptop and the ability to vocally command it to act. What a great idea for 21st century Puppy kennel.
_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engines or use DogPile
Back to top
View user's profile Send private message 
ETP


Joined: 19 Oct 2010
Posts: 908
Location: UK

PostPosted: Tue 22 Sep 2015, 04:39    Post subject: Houston we have Voice Control - Pet for any Pup - Sept 2015
Subject description: Bugatti Veyron edition.
 

Update:

In the FAQ above I mentioned eliminating the display of the menu completely when a poster
on the wall is preferred to list the numbers & their associated purposes.

The attached file is a version of the "vcfront_end" script that does that and you will be invited
to speak 3 seconds after pressing the pause key or clicking the microphone icon.

Once you get used to this concept, you may wish to adopt this way of doing things which is my own
personal preference.

Please make sure that you back up the original "vcfront_end" script & then substitute the one below ensuring that it is executable.
vcfront_end.gz
Description  Please remove false .gz
gz

 Download 
Filename  vcfront_end.gz 
Filesize  1.18 KB 
Downloaded  86 Time(s) 

_________________
Regards ETP



Kennels

Last edited by ETP on Wed 04 Nov 2015, 04:43; edited 2 times in total
Back to top
View user's profile Send private message 
tallboy


Joined: 21 Sep 2010
Posts: 604
Location: Oslo, Norway

PostPosted: Tue 22 Sep 2015, 13:55    Post subject:  

ETP, I tip my hat to you. This is a really clever Idea !
Making use of already existing programs in a new way to make an application is also a very sensible approach, no need to reinvent the wheel every time you have an idea. Very Happy

tallboy

_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
ETP


Joined: 19 Oct 2010
Posts: 908
Location: UK

PostPosted: Sun 31 Jan 2016, 15:09    Post subject: Houston we have Voice Control - Pet for any Pup - Feb 2016
Subject description: New Pet ( V3 )
 

Version 3 of the Voice Control Pet issued Feb 2016

Prerequisites for V3 Pet: (Slight change from V1)

    Active Internet connection

    Google Chrome or Chromium ( With working voice search. “O/K Google” not required)

    Chrome or Chromium must be set as the default browser. (New)

    VLC

    xdotool (32 & 64-bit versions in download folder)

    xclip (In most Pups - check with pfind)

    Xclipboard (In most Pups - check with pfind - Disable any other running clipboard)


Changes in this version:

The display of the front end menu is eliminated so the red microphone and the instruction
to "Speak now" will appear within about 3 seconds of pressing the pause key.
A copy of the menu is reproduced below and is also attached as a text file so that you can print it out.

Various timings in the main script have been tweaked to account for the fact that Chrome is not as quick as it used to be.

The script now searches for the first number in the question which means that even if Chrome heard
the question SIXTY PLUS ZERO as 60 + 10 rather than 60 + 0 only the digits in front of the plus sign
are extracted and script 60 would still be launched.

Launcher Scripts:

O.O.T.B. the pet contains 7 numbered launcher scripts ( 20, 30, 31, 32, 60, 61, 62)
These serve as both examples and templates. Pick the one that most resembles your needs, save it as a new number, then edit it to launch the app/script/url of your choice.
Each new launcher script that you create can perform any action you wish the only limit being your imagination.


Where to get the V3 Pet:

https://drive.google.com/folderview?id=0B_iVVJCd9q09aEdqY0oxVWh2STg&usp=sharing

Setup Procedure:

1. Check that you have Google Voice search working & that the prerequisites are met.

2. Install the pet.

3. Drag the .desktop file onto the desktop. Assign it the “Pause” key as the keyboard shortcut. Edit the text & change the icon if you wish.

4. Press the “Pause” key. Ignore “O/K Google” if enabled. Wait for the red microphone to appear and the instruction “Speak now”.
vcmenu.txt.gz
Description  Please remove false .gz
gz

 Download 
Filename  vcmenu.txt.gz 
Filesize  703 Bytes 
Downloaded  55 Time(s) 
menu.png
 Description   OOTB Menu items. The numbered scripts also serve as templates.
 Filesize   84.49 KB
 Viewed   360 Time(s)

menu.png


_________________
Regards ETP



Kennels
Back to top
View user's profile Send private message 
Pelo


Joined: 10 Sep 2011
Posts: 10093
Location: Mer méditerrannée (1 kms°)

PostPosted: Sat 13 Feb 2016, 18:16    Post subject: oh voice control is great interest for me..  

oh voice control is great interest for me... No real need, but for fun..
Windows 7 has a voice recorder included. The more you use it ... the less it :)Works
with Puppy, if with Precord we register our vocal order 'Abiword', Puppy could open it, that would be useless, but nice..
In fact it would be a Pfind, not with letters, but with audio.
If it find an audio similar, it launches abiword
Foolish, or not foolish ?

_________________
November : protect your Puppies of frosts (to freeze, Confused froze, frozen)
Back to top
View user's profile Send private message Yahoo Messenger 
ETP


Joined: 19 Oct 2010
Posts: 908
Location: UK

PostPosted: Sun 14 Feb 2016, 04:07    Post subject: Voice Control - New Pet for any Pup V3 - Feb 2016  

Hi Pelo,

Voice control is certainly fun and can be very convenient. This pet can also be used as
the basis for an accessibility Pup.
There is no need to start recording command words. It is meant to be simple.
If you wanted to launch "Abiword" by voice open up the template script number 20 which currently reads as follows:

Code:
#!/bin/sh
#exec /usr/bin/thunderbird "$@"
defaultemail &


Save it as script number 21 then edit it to read as below:

Code:
#!/bin/sh
#exec /usr/bin/thunderbird "$@"
#defaultemail &
defaultwordprocessor &


Press the pause key and when the instruction “Speak now” appears all you need say to trigger that script is:

TWENTY ONE PLUS ZERO

_________________
Regards ETP



Kennels
Back to top
View user's profile Send private message 
Pelo


Joined: 10 Sep 2011
Posts: 10093
Location: Mer méditerrannée (1 kms°)

PostPosted: Mon 15 Feb 2016, 13:58    Post subject: Good idea  

Wink hum, good idea... being tried soon.
_________________
November : protect your Puppies of frosts (to freeze, Confused froze, frozen)
Back to top
View user's profile Send private message Yahoo Messenger 
Display posts from previous:   Sort by:   
Page 1 of 1 [9 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0538s ][ Queries: 12 (0.0049s) ][ GZIP on ]