Free Text-to-Speech

Text-to-speech is great for the lazy, visually impaired, or people with reading disabilities. I think I read much, but I also count myself to the lazy and I like it to be read to. I found a simple way to select some text, for example in a webpage or a PDF, and let it be spoken using free software.

Introduction

I used to have this on my Mac, people even had this on the amiga, and I also know of some firefox add-ons that give this functionality, such as Text to Voice.

Is something like this possible for free, system-wide, on Linux or Windows? Short answer: Yes. Now I explain how with a simple trick you can hear any text that you select, in any program. I concentrate on installation on ubuntu, but similarly this should be possible on other linux distributions, on MacOS, and Windows.

There are several free software projects that produce speech synthesizers. Possibly the two best known free text-to-speech (TTS) systems are espeak and festival. Both come packaged in many linux distributions but can also be installed on other platforms, such as Mac OS or Windows.

TTS with Espeak in Ubuntu

Espeak is a speech synthesizer for English and many other languages. On ubuntu, installation could not be easier: use synaptic or type sudo apt-get install espeak.

Espeak reads text, for example, try: espeak -f sometextfile. You have options to adjust reading speed, pitch, and a choice of different voices in different languages (in ubuntu just look in /usr/share/espeak-data/voices/es-la). Try: echo "hola" | espeak -v es. You can also put these and other options directly into the files in espeak-data directory, thereby creating new voices.

Now how to read text that you select?

I found a nearly complete solution and here I am going to spell it out.

If you use Gnome as window manager, go to system->preferences->keyboard shortcuts
(if you use KDE or other managers, this should be similar), add a new shortcut.

name: read text
command: bash -c "xsel | espeak"

Then define a key combination. I defined windows button-R.

Now you can select text in any application press your keys and hear the text as it is spoken to you.

Refinement

This works already, but you can make some improvements.

I found that filtering out newline symbols was nicer to the ear, because the pauses at the end of each line make it sometimes hard to understand. The command to hear the text without newlines would then be (thanks!):

Change the command in the keyboard shortcuts to this:

bash -c "xsel | sed -e :a -e '$!N;s/\n/ /;ta' | espeak -s 180 -v en-us"

Of course you can put more elaborate filters instead of the sed command. For example you can substitute "i.e." for "this is." For theater plays you could use different voices for each characters.

I also put in some filters. For example I don't want to hear "i.e." spoken as "IdotEdot" but as "this is."

Here comes my filter file, which you can copy. I stored this file as /usr/share/espeak-data/espeak.sed

s/i\.e\./this is/g
s/e\.\g./for example/g
s/et al\./and others/g
s/\([A-Z]\)\([A-Z]\)/\1 \2/g

If you want to use these filters, your command would look like this:
command: bash -c "xsel | sed -e :a -e '$!N;s/\n/ /;ta' -f /usr/share/espeak-data/espeak.sed | espeak -s 180 -v en-us"

Finally I also defined a key combination, windows button-S to stop the reading.
name: stop text
command: pkill -9 espeak

Note that instead of espeak you can also use the festival speech synthesis system. Install typing sudo apt-get install festival. A simple test: echo hello | festival --tts. I needed to switch to ALSA output for it to work. See configuration options at the archlinux wiki.

Enjoy. Please tell me of any improvement you come up with.
[ Read more... ]

Alternative Blogging Platforms

A blogging platform is the combination of hosting service and software for the purpose of maintaining a weblog. The most common platforms are blogger.com, always hosted with google (usually with the blogspot.com domain), and the wordpress software, on paid hosting services or using the wordpress.com hosting service. Other popular services are Typepad or liveJournal. In this post I want to show an alternative that can beat these services in price, customization, and loading speed. It involves using free software (as in beer and in spirit) with the google app engine as a hosting service.


Introduction

All blogging platforms have some limitations. Blogger is free and easy to use. Its scripting language, Blogger XML, is very limited, which brings problems for extensions and search engine optimization (SEO). I have the impression that it is also a bit buggy sometimes.

Wordpress presents a more professional look than blogger. It offers to download and self-host the wordpress software (which is free software), with many possibilities for extension with plugins to help presentation and SEO.

Both blogger and wordpress.com are very fast to load from everywhere on the world, because they use a content delivery system. The same is not automatically given with self-hosted blogs, where the download speed depends on the distance of the reader to the hosting server.

Blogging Software for the Google App Engine

Now, it would be great to have a blogging platform, which is freely extensible (free and open software) like wordpress, fast to load using a content delivery system, and free of costs. There is more and more blogging software emerging that can be hosted on google app engine (GAE). This fulfills the three criteria: it is free and open software, it is fast to load (because of GAE), and it is free of costs (if you don't get millions of visitors at least).

I took a look at blogging software for GAE. Some of them are still in early stages of development, others are more mature. There are huge differences with respect to feature sets. I made a wishlist of features that I want a blogging software to have. My list is based on the post Show me your open source Django blog application.

  1. (Elegant) user interface for managing the blog.
  2. WYSIWYG post editor.
  3. Publishes (RSS and/or Atom) feeds.
  4. Allows importing and exporting of posts.
  5. Post authoring in teams.
  6. Compatibility with most browsers (Firefox, Safari, Konqueror, Internet Explorer 7 and 8).
  7. Documentation of the software.
  8. Native comment system (non-javascript, because of SEO).
  9. Support for remote publishing (for example via scribefire, windows live writer or the metaweblog api).
  10. Project actively developed.
  11. Importer from Blogger.
  12. Importer from Wordpress.

List of Blogging Software

I compiled a list of python software that runs on GAE. I found it remarkable that many of the projects are written by Chinese developers, presumingly because of access restrictions to more common blogging platforms (such as blogspot.com) from within the Chinese mainland. A very influential blog software is bloog; many projects have been based on its code. Again: the projects are in different states of maturation. Setting up a blog on GAE requires at least some knowledge of programming. I put down the list without many comments. There's no special order, although I put my personal favorites as the first.
SoftwareDemo
Tom Strummer Bloogdemo
cpediaPing Chen's blog
i-heredemo
Pyweblogdemo
appengineblogsoftwareDeveloper Advocate
vasaoveltema.jp
JoeyBdemo
Pinax Combono demo yet(?)
Project Pickydemo
Micoblogdemo
toon blog
demo
This blogging software does not run on GAE, but I still list it because it is great (free) software as you can see in the demos.



SoftwareDemo
Django Techblog"demo
byteflowdemo 1demo 2
Mighty Lemondemo
Kukkaisvoimademo
Frogdemo


Enjoy. Please leave a comment below for questions and suggestions.
[ Read more... ]

Digg 5 Years Old

I just received a mail by digg.com celebrating their 5th anniversary and I thought it was worth commemorating this event with a post. Digg is one of the biggest social bookmarking websites. Inspired by slashdot, Kevin Rose, then 27 years old, founded digg on December 4th, 2004. Since then the site overtook slashdot in popularity and spawned itself many imitations. In this post there is more on digg.

Digg is a do-follow social bookmarking site with pagerank 7, very popular with news submitters. At alexa rank 99 (as of Jan 2010) it is one of the biggest social bookmarking sites by traffic volume (compare other social bookmarking sites by traffic, do-follow status, and pagerank).

People from digg created a promotional video about their anniversary, which you find below.


I looked up the search volume trend at google trend where I found the number given in the video of about 30,000 monthly visitors roughly confirmed. According to google websites trends, digg.com had about about 1.4 million unique daily visitors. At the same link address you'll see that digg's growth seemed to stagnate in 2009.

Search volume for search volume for the term digg.


Scale is based on the average worldwide traffic of digg in all years. Learn more
digg 
1.00
  
reddit 
0.18
  
slashdot 
0.62
  
stumbleupon 
0.22
  
 Rank by   
Digg.comNewsBusters - May 2 2007   
Digg and MicrosoftTechnology News Daily - Jul 26 2007   
Google + Digg?InformationWeek - Jul 23 2008   
VCs shovel another $28.7 million into DiggBusinessWeek - Sep 24 2008   
Digg Ads: Digg or Bury Ads to express your opinionOzel Web Tasar $(C)% (Bm - Jun 4 2009   
Reddit Runs Elaborate Secret Santa ExchangeNewsNet5.com - Dec 17 2009   
More news results »

The graph shows that search volume for digg (in light blue) increases very much until 2007. In fact you can see that the term digg passes slashdot (yellow) in popularity in the beginning of 2006. The letter A marks the digg revolt. This was when Digg, prompted by legal threats, took down a news with more than 10,000 votes about the decryption of HD-DVDs. Because of massive protests they put the news on-line again. Since then, since May 2007, search volume for digg has been going down slowly but steadily, while competitors such as reddit (in red), and stumbleupon (green) have been catching up.

Many people go to webpages searching for the name of the webpage, so search volume for the name of the webpage could be indicative of its visitor statistics. On the other side, many regular visitors may have bookmarked the page or may have learned it URL (it's short enough), so search statistics alone may just as well be misleading.

However, looking at Alexa pageview statistics for 2009 for digg.com sems to confirm the impression that digg does not grow that much anymore. See alexa statistics for digg.com in the image below.
Alexa statistics for pageviews on digg.com

Unfortunately Alexa.com and compete.com do provide statistics only for time periods until two years and a half.

Is digg being overtaken by other sites? What is your impression of digg.com or other social bookmarking sites for that matter?

If you liked this article you might be interested in other articles on My Outsourced Brain. Some time ago I summarized information from several scientific studies about how and when to submit articles to digg, you might want to check it out. If you want to put a digg widget on your blog, you could be interested in my post about social voting widgets.
[ Read more... ]

Widgets for Most Popular Articles on Twitter, Digg, Delicious, Propeller, and Reddit

One of the most appealing elements on a webpage are "popular posts". There are several possibilities to get popular posts, e.g. by number of comments or visitor statistics. In this post I present 5 widgets that display your highest voted posts from social websites. These widgets can serve to increase visitor involvement and as navigational element. Some of these widgets display a vote or bookmark button and can help you to attract more visitors by social recommendations.

I thought why not install a widget that displays popularity in terms of votes, motivates people to vote, and thereby attract more visitors, while at the same time serving as navigational elements.

I was searching several of the most popular social websites to find possibilities to get such widgets. I found such widgets for Twitter, Digg, Reddit, Delicious, and Propeller.

Here you find demos: Twitter Demo, Digg Demo, Reddit Demo, Delicious Demo, Propeller Demo

For each widget I will show a javascript code which you can simply copy and paste with very few changes that I indicate. You can do so without any knowledge of HTML or javascript. In blogger you can create a new HTML widget in layout, paste the code, and there you go with a new widget.

Digg - Most Dugg

<script type="text/javascript">
digg_id = 'digg-widget-container'; //make this id unique for each widget you put on a single page.
digg_title = 'title';
</script>
<script type="text/javascript" src="http://digg.com/tools/widgetjs"></script>
<script type="text/javascript" src="http://digg.com/tools/services?type=javascript&amp;callback=diggwb&amp;endPoint=%2Fuser%2Fusername%2Fsubmissions&amp;count=5&sort=digg_count-desc"></script>


Change username for your digg user name and title for the title you want to see displayed in the widget. You can change the number of posts displayed by changing 5 to any other number.

Reddit Most Popular

<script src="http://es.reddit.com/user/username/submitted.embed?limit=5&sort=hot" type="text/javascript"></script>

Change username for your reddit account name. You can change the number of posts displayed by changing 5 to any other number.

Propeller Most Popular

For this widget I had to create a yahoo pipe.
<script type="text/javascript">
function pipeCallback(obj) {
document.write("<ul>");
var i;
for (i = 0; i < obj.count ; i++)
{
var href = "'" + obj.value.items[i].link + "'";
var item = "<li>" + "<a href=" + href + ">" + obj.value.items[i].title + "</a> </li>";
document.write(item);
}
document.write("</ul>");
}
</script>
<script src= "http://pipes.yahoo.com/pipes/pipe.run?_render=json&_callback=pipeCallback&
_id=6e954c49f0ea1f933e9faf78321799a1&userid=username&num=5" type="text/javascript"></script>


Again you should put in your username, this time at propeller, and you can change the number of posts displayed.

Delicious Recent Bookmarks

Delicious provides a linkroll, which sorts your bookmarks alphabetically or by date.
<script type="text/javascript" src="http://feeds.delicious.com/v2/js/username?title=Most Popular on Delicious&icon=m&count=5&sort=date&tags&extended&name&showadd"></script>


Put in your username and there you see it on your blog.

Twitter - Most Tweeted Posts

This is the longest code, fear not. At the end are the options you'll have to change, indicated in bold.

<style type="text/css">
/* ul list */
ul.pot{
padding:0;
margin:0;
}
ul.pot li{
border-bottom:silver 1px solid;
float:left;
margin:1px 0 1px 0;
padding:2px;
list-style-type:none;
/* height:50px; */
width:100%;
overflow:hidden;
}
/* link span */
ul.pot span.pot-url{
display:block;
font-weight:bold;
}
ul.pot span.pot-url a{
text-decoration:none;
}
ul.pot span.pot-url a:hover{
text-decoration:underline;
}

/* tweet content */
ul.pot span.pot-tweet{
color:#333
}

/* link meta : tweets, score,.. line */
ul.pot span.pot-meta {
color:#006699;
display:block;
font-size:90%;
margin:3px 0 0;
}
ul.pot span.pot-meta a{
color:#006699;
text-decoration:none;
}
ul.pot span.pot-meta a:hover{
text-decoration:underline;
}
/* tweeter username span */
ul.pot span.pot-tweeter{
padding:0 2px;
}
/* tweets count span */
ul.pot span.pot-tweets{
padding:0 2px;
}
/* score span */
ul.pot span.pot-score{
padding:0 2px;
}

/* customize @user links */
ul.pot a.pot-at { }
/* customize #hashtags links */
ul.pot a.pot-hashtag { }
</style>
<!-- required CSS :END -->

<!-- required javascript :include once -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src="http://popular-on-twitter.googlecode.com/files/jquery.popular-on-twitter-1.0.min.js" type="text/javascript"></script>
<!-- required javascript :END -->

<!-- required HTML -->
<div class="popular-on-twitter" options="{
site:'blogurl'
,show_n:0
,n:5
,animate:'height'
,tweeter_text:''
,show_tweet:1
}">loading..</div>
<!-- required HTML :END -->


Here you should change blogurl to your websites web address without the http://www. part (e.g. myoutsourcedbrain.com). The parameter n indicates the number of posts you want to have displayed (here 5).

See the widget's google code project page for an explanation of more options.

Credit for this widget goes to Moretechtips, where the widget was shown in the post Popular-on-Twitter Widget: Topsy-enabled jQuery Plugin.

Enjoy. Please leave a comment below for questions and suggestions.
[ Read more... ]

 

Most Viewed

Recent Posts

Blog Archive