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 23 Sep 2014, 18:49
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
Chatterbox - STT / TTS / TTA project. Part 2
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 6 of 6 [89 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6
Author Message
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Sat 19 Oct 2013, 14:56    Post subject:  

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>

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2551
Location: New Zealand

PostPosted: Sat 19 Oct 2013, 14:58    Post subject:  

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 Smile
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2551
Location: New Zealand

PostPosted: Sat 19 Oct 2013, 15:00    Post subject:  

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...
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2551
Location: New Zealand

PostPosted: Sat 19 Oct 2013, 15:25    Post subject:  

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?
Back to top
View user's profile Send private message 
H4LF82


Joined: 02 Oct 2012
Posts: 124

PostPosted: Sat 19 Oct 2013, 15:38    Post subject:  

Quote:
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. Smile

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!

_________________
"The wise know their weakness too well to assume infallibility; and he who knows most, knows best how little he knows." - Thomas Jefferson
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Sat 19 Oct 2013, 17:16    Post subject:  

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:
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 &

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
H4LF82


Joined: 02 Oct 2012
Posts: 124

PostPosted: Sat 19 Oct 2013, 17:53    Post subject:  

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...

[/img]

_________________
"The wise know their weakness too well to assume infallibility; and he who knows most, knows best how little he knows." - Thomas Jefferson
Back to top
View user's profile Send private message 
Ted Dog


Joined: 13 Sep 2005
Posts: 2333
Location: Heart of Texas

PostPosted: Sat 19 Oct 2013, 21:36    Post subject:  

Dog clicker(cheap metal tab) is VERY loud, and is making my real farm dog nervous. Laughing
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2551
Location: New Zealand

PostPosted: Sun 20 Oct 2013, 20:25    Post subject:
Subject description: SphinxKeys
 

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
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Mon 21 Oct 2013, 17:52    Post subject:
Subject description: SphinxKeys
 

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)

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2551
Location: New Zealand

PostPosted: Fri 25 Oct 2013, 20:24    Post subject:  

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.php?p=732885#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....
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2551
Location: New Zealand

PostPosted: Sun 27 Oct 2013, 13:07    Post subject:  

Don't know how, but I seem to have deleted this post. Durn it.
Last edited by greengeek on Fri 01 Nov 2013, 19:31; edited 1 time in total
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2551
Location: New Zealand

PostPosted: Fri 01 Nov 2013, 19:31    Post subject:  

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.php?p=731145#731145
.
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2551
Location: New Zealand

PostPosted: Fri 22 Nov 2013, 14:04    Post subject:  

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.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 6 of 6 [89 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects
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.0923s ][ Queries: 12 (0.0063s) ][ GZIP on ]