Page 4 of 5

Posted: Sat 19 Oct 2013, 18:56
by technosaurus
H4LF82 wrote:...yeah, that was getting necessary. i have a sscript running somewhere in all of this tat is filling my root folder with blank directories every hour...ive rebooted from the live cd and started a new savefile just for this project, and since it now has its own sfs, it might as well be structured correctly too.
If you take a look at my little example, it uses no disk space unless "dictate" is toggled and then it only writes to a single file in the user's $HOME directory. *nix OSs (including puppy linux) can operate on streams, so unless you are planning to use the output data from pocketsphinx_continuous for analysis to maybe patch the source there is really no need to use a temporary file(s).

With that being said, I realize pocketsphinx_continuous has a lot of superfluous options, but without a decent sound system it is difficult for me to separate the wheat from the chaff. If anyone cares to take note of what command line args and output strings are of limited value, I'd be willing to thresh them out of the source code. If we are always needing to set an arg to a certain value, I can hard code it, if an arg is never used I can remove it and if the output would be better in a different format, that can be done (for example using a time-since-epoch style integer time stamp instead of 0000000001: ....)

in shell that would be date +%s

or in C
struct timeval tp;
gettimeofday(&tp);
int seconds = tp.tv_sec

to convert them to a date string in shell
date -d @1382162295 <options_here>

Posted: Sat 19 Oct 2013, 18:58
by greengeek
H4LF82 wrote:/ussr/share/chatterbox/ is now the directory for it, if there are no objections?
cheers!
I certainly have no objections. I am a little concious that chatterbox may end up being a messy collection of poorly coded (yet hopefully functional) scripts that represent our attempts to achieve our various goals...

But then, if that happens, there is nothing to prevent a better coder improving things and maybe in the end chatterbox just becomes a testing ground that makes way for a more professional effort which could have a better name (VoiceBox maybe...). What do you think?

I'm kind of enjoying being able to throw my 'chatterbox' ideas into the ring and learning some basics of scripting but I don't want to be blamed for filling the puppy coffers with bad code :-)

Posted: Sat 19 Oct 2013, 19:00
by greengeek
technosaurus wrote:so unless you are planning to use the output data from pocketsphinx_continuous for analysis to maybe patch the source there is really no need to use a temporary file(s).
That's excellent - I felt bad about using the temp file. Seemed a bit clunky. At least it helped me get to first base though...

Posted: Sat 19 Oct 2013, 19:25
by greengeek
technosaurus wrote:and if the output would be better in a different format, that can be done
Does that mean it might be possible to get a single word output from sphinx - eg: just the command word itself?

Posted: Sat 19 Oct 2013, 19:38
by H4LF82
If you take a look at my little example, it uses no disk space unless "dictate" is toggled and then it only writes to a single file in the user's $HOME directory.
...oh, please dont misunderstand. I get it! im not complaining. i expect that this will end up as a Frankenstein of code and be as cringe-worthy as it gets to the trained eye...and i dont care. im as happy as a pig in filth if the code is sloppy and im prepared to create new sfs files a thousand times over if thats what it takes.

and im happy for the testing folder to contain a million empty directories. just not my root folder. that folder is cluttered enough and i have a terrible time navigating folders now as it is. buried in /usr/share/chatterbox is a good place for testing files IMHO...thats all i was saying. :)

forgive me if it sounded like i was wingeing!

and i agree that txt files are clunky. it was my suggestion, and i suggested it because it gives me a physical place to put the stdout without having to use a console where i can physically SEE it the moment it gets created. by all means, remove the text file and use the stdout ...someone with a console who trusts their eyes, please!

Cheers!

Posted: Sat 19 Oct 2013, 21:16
by technosaurus
H4LF82 wrote:and i agree that txt files are clunky. it was my suggestion, and i suggested it because it gives me a physical place to put the stdout without having to use a console where i can physically SEE it the moment it gets created. by all means, remove the text file and use the stdout ...someone with a console who trusts their eyes, please!

Cheers!
You might be interested in the Xdialog --tailbox option which can read a file as it is modified.

an adaption of my code could enable that:

Code: Select all

touch /tmp/speech_out
pocketsphinx_continuous $SOMERANDOMOPTIONS |while read ROW DATA; do
case "$ROW" in
    [0-9]*:)echo $DATA;;
esac
done >> /tmp/speech_out &
Xdialog --tailbox  /tmp/speech_out 0 0 &

Posted: Sat 19 Oct 2013, 21:53
by H4LF82
technosaurus, thank you! i love xdialog...and was going to suggest it if it didnt come up naturally in the conversation.

Xdialog.will be important because some users will still want a visual representation of "what is going on" as well as an audible one. id like to see the ability for the userto turn Xdialog on and of f...and when it is turned on it should produce an xdialog box that times out if you dont press OK after a few seconds, and should appear whenever the system makes an alert tone...

that way the user is never left wondering what just happened. and anytime the user gets stuck wondering whaat juust happened, the program should loop back and try again. like ths...

Image[/img]

Posted: Sun 20 Oct 2013, 01:36
by Ted Dog
Dog clicker(cheap metal tab) is VERY loud, and is making my real farm dog nervous. :lol:

Posted: Mon 21 Oct 2013, 00:25
by greengeek
In terms of extending functionality and expanding user interaction down the track - this info about a program called SphinxKeys seems interesting:
http://code.google.com/p/sphinxkeys/wiki/README

Posted: Mon 21 Oct 2013, 21:52
by technosaurus
greengeek wrote:In terms of extending functionality and expanding user interaction down the track - this info about a program called SphinxKeys seems interesting:
http://code.google.com/p/sphinxkeys/wiki/README
Cool but requires python and most of that is handled in ~5lines of shell for "open" we can try xdg-open (its a rox wrapper in puppy) to open any supported file type and fallback to trying to execute it as a program as in my example stub.
For the sendkeys, scottman is already using xdotool for vlc-gtk (I've compiled a similar key/mouse tool that uses xcb vs Xlib to send events)

Posted: Sat 26 Oct 2013, 00:24
by greengeek
I think we are at the point where quite a few different scripts might come to light for voice-controlled functions for different purposes, so I thought it might be worthwhile to have a separate thread just as an archive for .dic files (and associated scripts if any have been written to match that dic file)

(ie: if you want to write a script using a specific vocabulary you just grab an existing dic file that contains the vocab you need)

Thread here:
http://murga-linux.com/puppy/viewtopic. ... 885#732885

Each project may suit a different dic file (and some projects might even use a number of dic files to suit different instances of pocketsphinx running at different times (sounds clunky but it might work if well written...)

The dic files normally start with a number eg: 6718.lm 6718.dic but it seems to work fine to rename them as long as you reference the new name correctly in the pocketsphinx start parameters

eg:
#pocketsphinx_continuous -lm starter002.lm -dict starter002.dic

or:

/usr/bin/pocketsphinx_continuous -lm wordprocessing.lm -dict wordprocessing.dic

Just rename the dic files to identify whatever your vocab is focused on....

Posted: Sun 27 Oct 2013, 17:07
by greengeek
Don't know how, but I seem to have deleted this post. Durn it.

Posted: Fri 01 Nov 2013, 23:31
by greengeek
greengeek wrote:So far I've been trialling voice commands without a preceding "trigger word" like 'computer' as used in the example above but I think there are times when it will be critical to use a trigger word or phrase. I think there are advantages to both methods and I think it might be useful to be able to switch between two modes (simple mode and complex mode)
Sorry to quote myself, but I did succeed in getting the voice menu to switch on command from simple vocab to more complex vocab in order to satisfy different needs.

I will be developing that idea more in the 'part 4' section of this project and have developed a standalone .pet that allows easy testing / demonstration of this functionality:
http://murga-linux.com/puppy/viewtopic. ... 145#731145
.

Posted: Fri 22 Nov 2013, 18:04
by greengeek
I have put together a puppy that integrates my new version of the voice control functionality. I call it voxpup: Thread here:
http://murga-linux.com/puppy/viewtopic.php?t=90391

I'm still also focusing on improving and extending my original scripts but just thought a full puppy was a good way of testing the functionality so far and maybe getting a wider audience for testing/feedback.