Clipboard tools and Hotkeys for jwm

Stuff that has yet to be sorted into a category.
Message
Author
User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

Clipboard tools and Hotkeys for jwm

#1 Post by technosaurus »

You can now use the contents of your clipboard to:
  • google (Alt+s) - requires seamonkey
    thesaurus (Alt+t) - requires gaiksaurus
    t2s(Alt+l) - requires seamonkey
I recommend setting seamonkey to play .wav with /usr/bin/aplay
You can access them from all the command line as well

I will add some of the stuff from 4.2 in the next one, but these are new AFAIK

I went through some effort to figure out how to add the keybindings without removing any that you have installed (using sed in the pinstall.sh script)

I'm sure that these will interfere in some way with some program... just change your window focus (click on a different window or the desktop) for instance - trying to use the thesaurus in Seamonkey will bring up the "Tool" Menu. Simply minimizing the window will allow you to bring up the thesaurus for your clipboard contents

Edit: To change the keybindings

Code: Select all

defaulttexteditor /root/.jwm/jwmrc-personal
Attachments
hotkeys-0.1.pet
with guis added
(1.05 KiB) Downloaded 708 times
hotkeys-0.0.pet
(990 Bytes) Downloaded 616 times
Last edited by technosaurus on Mon 23 Nov 2009, 07:26, edited 1 time in total.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Re: Clipboard tools and Hotkeys for jwm

#2 Post by mcewanw »

technosaurus wrote:trying to use the thesaurus in Seamonkey will bring up the "Tool" Menu.[/code]
Actually, it didn't; using Puppy 4.3.1 with its default Seamonkey 1.1.18, highlighting some text and then pressing Alt-t brought up gaiksaurus. Excellent! I didn't use your dotpet though, since I had already installed the appropriate "thesaurus" script based on the code you published in another related thread:

http://www.murga-linux.com/puppy/viewto ... 398#364218

I'm using both gaiksaurus and Artha (like wordweb) http://www.murga-linux.com/puppy/viewto ... 398#361204 (which includes dictionary functionality): the combination of both is extremely powerful (gaiksaurus provides lots of thesaurus synonyms) and Artha, lots of other detail about words, their meanings, and their relationships generally. Artha's hotkey is Ctrl-Alt-w and, once installed via sikpuppy's dotpet, is first started from JWM Menu -> Documents category (after that it sits as an icon next to volume control and clock; like wordweb in windows).
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Festival TTS online version

#3 Post by mcewanw »

I've now installed your dotpet.

In Seamonkey 1.1.18 preferences, Helper Applications, I set mime type audio/x-wav to Open With /usr/bin/aplay. I must say that I am impressed with Festival's online Text-To-Speech synthesiser quality, though I had a longish wait being only on dialup. Apparently, the Festival website will only allow a maximum of seventy characters at a time though.

I should probably consider upgrading foksyfeyer to use this new Festival speech engine (a downloaded offline version) instead of espeak.
github mcewanw

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#4 Post by technosaurus »

The 70 character limit does not apply to my hack.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

demo purposes only

#5 Post by mcewanw »

For some reason only short highlighted clips would play for me.

I also wonder if you noticed the note on the bottom of Festival's webpage:
(NOTE: This page is provided for demonstration purposes only. Direct use of the CGI synthesis interface is not permitted (computer resources reserved for this demo are limited).
I don't think it would be good to bypass that; they do offer the software free now after all. Wouldn't want them to get stroppy! :-)
github mcewanw

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#6 Post by technosaurus »

Thanks for the heads up on that. I'll probably remove the text2speech portion then. I had just made a gui for it too.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

jakfish
Posts: 762
Joined: Fri 18 Jul 2008, 19:09

#7 Post by jakfish »

Works very well for bringing up the copied word in the thesaurus. Execpt in wine/word 97. alt-t will bring up an empty thesaurus--no big deal since word is already in clipboard, so just keystroke alt-v, enter

Odd, though, the wine/word 97 thing. For instance, a user can copy word 97 text and paste into bonafide linux apps. Don't know why xclip won't drop the cntl-c-ed word into thesaurus. But as I said, the solution is nothing more than two keystrokes.

Thanks for your good ideas,
Jake

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

use a non-restrictive online synthesiser or use espeak

#8 Post by mcewanw »

A couple of alternatives for the voice part (looking forwards to your GUI!):

I had a look at an alternative online voice synthesis demo site: www.festvox.org. Though the synthesis quality isn't so good using that source, there didn't seem to be any forced restrictions on usage. So for your /usr/bin/t2s script I used the following code instead:

Code: Select all

#!/bin/sh
if [ ! $1 ];then
MYWORD=`xclip -o`
else
MYWORD=$@
fi
seamonkey -remote "openurl(http://www.festvox.org/cgi-bin/gen_fest.wav?format=wav&voice=slt_arctic_cg (American Female)&text=$MYWORD,NEW-TAB)"
Festvox possibly won't really like people accessing their online demo via cgi, but they don't appear to say so (hence no legal ramifications or at least less likelihood of being locked out by the serving site).

Actually, I still prefer an offline solution and would suggest simply installing espeak for clipboard reading in conjunction with your hotkey script. The espeak dotpet download isn't large (approx 600 kB) and it consumes relatively few resources in operation. [I realise nevertheless that you have your eyes on something of almost zero size to include in Puppy 4.4, but espeak could be left as an add on option perhaps? - actually, I think espeak is so useful for accessibility reasons that it is small enough that it should be considered for inclusion in default puppy downloads, especially with your hotkey popup idea, but it is easy enough to install as a dotpet I suppose...] For example, I am now using this for your t2s script:

Code: Select all

#!/bin/sh
if [ ! $1 ];then
MYWORD=`xclip -o`
else
MYWORD=$@
fi
echo $MYWORD | espeak
You need to have espeak installed of course. Since I have foksyfeyer installed on my system
http://www.murga-linux.com/puppy/viewto ... 717#364717
, I already have espeak, but if you want to avoid the 3.5 MB download of foksy, you could just install muggins' small espeak dotpet (along with the needed portaudio dotpet), which you can get from here:

http://www.murga-linux.com/puppy/viewto ... 158#164158

[EDIT: the above espeak pet is newer than the one muggins produced for the navsat app (in another thread) afterall]

Espeak may not sound quite so nice or natural as the best online Festival voices since by default it uses a small voice sample, but for me it is the best compromise solution in terms of functionality and resource usage for this simple clipboard reader application.

What added functionality did you have planned for the GUI you had in mind? Looking forwards to seeing that since this thesaurus/voice etc popup is a great addition to Puppy.
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

espeak with mbrola voices

#9 Post by mcewanw »

A wee bit better than the default supplied espeak "voice" is to use espeak along with mbrola. Unfortunately the typical "small" mbrola voice is around 5MB to download, but I find it worthwhile to my ears!

Here is an extract from the espeak website http://espeak.sourceforge.net/mbrola.html on how to install mbrola:
# To install the Linux Mbrola binary, download: http://www.tcts.fpms.ac.be/synthesis/mb ... br301h.zip. Unpack the archive, and copy and rename the file: mbrola-linux-i386 to mbrola somewhere in your executable path (eg. /usr/bin/mbrola ).

# Get the en1 voice from: http://www.tcts.fpms.ac.be/synthesis/mb ... pybin.html. Unpack the archive, and copy the "en1" data file (not the whole "en1" directory) somewhere convenient (eg. /usr/share/mbrola/en1 ).
You can then modify your t2s script to use espeak with the downloaded mbrola voice (example is for English male mb-en1) as follows:

Code: Select all

#!/bin/sh
if [ ! $1 ];then
MYWORD=`xclip -o`
else
MYWORD=$@
fi
echo $MYWORD | espeak -v mb-en1 | mbrola -e /usr/share/mbrola/en1 - - | aplay -r16000 -fS16
Still nothing like as clear as the Festival online TTS demo though...
github mcewanw

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#10 Post by technosaurus »

I actually compiled espeak without any extra libraries but then it will only output wav files (the whole package was ~100k once I stripped it down) I can compile it against portaudio statically to save some size if you need direct audio output, and have no other need for portaudio. It could save anywhere between 10 and 90 percent of the size of the portaudio libs and is usually faster with a smaller memory footprint.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

espeak and festival and

#11 Post by mcewanw »

I think one of the reasons muggins espeak dotpet is so big is that it includes the various "voices" espeak provides, not just the default one; also the dictionaries for the different languages. However, I'd be interested to see the size of and try the statically compiled portaudio one you suggest (but libportaudio.so only takes up about 135kb total installed on my system).

As far as best, non-commercial, non-huge, speak quality is concerned, it seems that the Festival in conjunction with one of the the enhanced Nitech HTS voices would be the way to go. Not a tiny download to get good voice but I think it comes in at well under 10 MB for Festival and the Nitech HTS voices (once a lot of unneeded stuff is removed from the Festival download stuff, I imagine...). Still won't be as good as the Festival online demo of course, but might be quite good. What I would really like, therefore, is a dotpet for the latest Festival... :-)

The Nitech HTS voices for Festival can be downloaded from here:

http://hts.sp.nitech.ac.jp/?Download#z142d16f
github mcewanw

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#12 Post by technosaurus »

I made espeak (actually only speak) as an app dir (every thing in the same directory) which will play really nicely with ROX. It is statically compiled against portaudio so no dependencies required.
just expand the tarball to /usr/local/apps
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Flite; also HTK (Hidden Markov Model Toolkit) info

#13 Post by mcewanw »

Thanks, I'll download that and try it out soon.

In the meantime, I'm checking out flite again. I think I may be able to use it with one of these new, superior, hidden markov model type voices, which should be much more useful than Festival on a low powered machine. Time will tell - I'll first need to download the devx for Puppy 4.3.1; I've been meaning to do that for a while, but only having dialup, I never got round to the effort. I'll download it overnight though.

Good quality, locally installed, open source (or at least "free") speech synthesis is a bit of a holy grail some others, and I, have been after for a while...! :-) Bound to arrive some day.

Microsoft, by the way, owns the copyright to one of the main international university research efforts in the field (HTK: the Hidden Markov Model Toolkit - originally developed at Cambridge University, UK), though to be fair to MS, they licensed it back to the research community and have allowed them to release/distribute the source code under a simplified BSD license: http://htk.eng.cam.ac.uk/

EDIT: On second reading, I don't think it is a BSD license, but a Cambridge Univ own license - open source though - can't remember where I read the BSD bit. Camb Uni still maintains and develops HTK.

Flite (source code) for HTS voices here!: hts-engine.sourceforge.net

in case anyone can't be bothered waiting on me making a dotpet of it (might take time - I'm painting a house for sale...)

Ah... the HTK license doesn't allow commercial use of the source... so the open source community can use it freely and develop it, but only Microsoft can use it commercially...
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

vozme

#14 Post by mcewanw »

vozme might be useful for your t2s script. It seems to be open source and freely accessible. Speech quality is very good (comes back as mp3).

I started a thread on vozme itself, just to announce it since nothing needs to be installed to make it work in a browser except a provided bookmarklet...

As for t2s, I can't get it to work there but since I don't really know what I'm doing that is not surprising:

Keeps coming back with the message from vozme: Text not found...

My latest try was:

Code: Select all

#!/bin/sh
if [ ! $1 ];then
MYWORD=`xclip -o`
else
MYWORD=$@
fi
seamonkey -remote "openurl(http://vozme.com/text2voice.php?lang=en&interface=full&gn=fm&text=$MYWORD,NEW-TAB)"
Note: the seamonkey -remote "openurl etc...." needs to all be on one line, I just can't get it to appear like that on the forum.

But the above is probably all nonsense. It is too late at night now, so I'm hoping you will provide correct sequence to make it work...

EDIT: The above code works. In my failed previous attempt, I used ? instead of & in various places... Still hope you will check it for me since I'm clearly half asleep...

In the above, change gn=fm to gn=ml if you want to hear a male voice instead of a female one
github mcewanw

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#15 Post by amigo »

Nice find there on the flite-hts combination. I've been using flite for a long time and have searched a lot for alternate voices for it -looks like this is promising.

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

can't get flite_hts to compile

#16 Post by mcewanw »

amigo wrote:Nice find there on the flite-hts combination. I've been using flite for a long time and have searched a lot for alternate voices for it -looks like this is promising.
It would be nice if I could manage to compile it!... but I haven't managed so far.

When I run ./configure, without any options, I get the error message:

Code: Select all

configure: error: Cannot find HTS_engine.h
./configure: line 4794: PATH_SEPARATOR: command not found
If anyone manages to compile this, please let me know how you did it! Being able to use a decent synthesised voice would be very good for use with software for the visually impaired.
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#17 Post by mcewanw »

Okay... I should have read the INSTALL text file (I gave it a glance but hardly read it... sigh!). Using the compile options given in there and it is now compiling fine. I'll report back on how it works or otherwise...
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

it is great - I'm very excited about this!

#18 Post by mcewanw »

amigo wrote:Nice find there on the flite-hts combination. I've been using flite for a long time and have searched a lot for alternate voices for it -looks like this is promising.
flite_hts_engine works great! No need to download a 100 MB voice data file and Festival for good quality voice. I have attached your words in voice form in a new thread for especially for discussions about flite_hts_engine. I'm working on a dotpet for it, and will announce that soon. Here is the new thread and "your" voice... amigo"

http://www.murga-linux.com/puppy/viewto ... 897#365897
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#19 Post by mcewanw »

@technosaurus: Your text2speech script brings up a text entry dialog if there is nothing in the clipboard (I think, though I've not been able to test that part), but how do you clear the clipboard anyway so that that event will happen whenever you want it?
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

using with flite_hts_engine latest

#20 Post by mcewanw »

If you want to use the latest flite_hts_engine (offline/local Quality local Text To Speech) with technosaurus's Hotkeys, replace the code in his /usr/bin/text2speech with:

Code: Select all

#!/bin/sh
MYWORD=""
if [ ! "$1" ];then
 MYWORD=`xclip -o`
 if [ ! $MYWORD ];then
 MYWORD=`Xdialog --stdout --inputbox "" 6 99 Text2Speech`
fi
else
 MYWORD=$@
fi
flitet $MYWORD | aplay
Details on getting flite_hts_engine for Puppy (dotpet only 1.4 MBytes) here:

http://www.murga-linux.com/puppy/viewtopic.php?t=49390
github mcewanw

Post Reply