jQuery Plugin Roundup 7: truncate, Text-to-Speech

20 Apr 2010 | By Alex Young | Tags jquery plugins audio

Welcome to the jQuery Plugin Roundup, episode 7. Remember you can send your plugins in for review through our contact form or @dailyjs.

jquery-text-truncate

jquery-text-truncate truncates text based on the rendered width rather than character count. Usage looks like this:

$("#element").textTruncate();

The element’s parent block is used as the source for the maximum width. This can be changed by passing a width option.

jQuery Text-to-Speech

jQuery Text-to-Speech by Kevin Hoang Le is a new plugin that converts text to speech using Google Translate’s audio rendering API, and a bundled Flash file to play the audio.

It’s easy to use:

var jtts = $('#jtts');
jtts.jtts({
    elem: '#embedPlayer',
    jPlayer: {           
        customCssIds: true,
        swfPath: '/media/swf/'
    }
});
 
jtts.play(['Welcome to DailyJS']).bind('onComplete', function() {
  // Called after the audio has been played
});

For a live demo, the author has created Voice-enabled Weather and Traffic Report. His blog post has more details.


blog comments powered by Disqus