Speech Synthesizer in 1K of JavaScript
Written by Ian Elliot   
Sunday, 18 March 2012

The idea of creating a speech synthesizer in JavaScript seem fairly incredible, but to do it in 1K characters is amazing.

First a warning - it isn't very good because it was necessary to drop plosive sounds to make it fit in less than 1K. However, for the right phrase it works very well.

The sad thing is that including the extra sound would only have pushed the size up to 1189 characters - but this is an entry in the latest JS1K competition and being under 1K characters is essential.

JS1Klogo

 

The speech synthesizer is based on a tiny formant synthesizer implemented in C++ by Stepanov Andrey. A formant synthesizer works by applying different input waveforms to a set of filters which modify the sound produced. This aims to model the way that the vocal chords provide an input to the vocal cavities which act as an acoustic filter.

In this case the input waveforms are simply a sawtooth or noise and most of the work is done by setting the parameters of the filter.

The cut down synthesizer supports The following sounds/phonemes:

a,b,d,e,E,f,g,h,i,j,k,l,m,n,o,p,r,s,S,T,t,u,v,w,z,Z

and you can try it out at speech synthesizer.

As it uses the HTML5 Audio object to generate the sound, you will need to make sure that you visit the link using a modern browser - I tried Chrome and Firefox.

Further Information

JS1K

Working speech synthesizer to try out

Details of the Speech Synthesizer entry

C++ speech synthesizer

Related articles

Tetris In 140 Bytes

Ray Tracer in JavaScript

 

kotlin book

 

Comments




or email your comment to: comments@i-programmer.info

 

To be informed about new articles on I Programmer, subscribe to the RSS feed, follow us on Google+, Twitter, Linkedin or Facebook or sign up for our weekly newsletter.

 

Banner


Perl v5.40.0 Shows That It Is Too Resilient To Die
01/07/2024

Having faced doubt, debate and insecurity, Perl is still going after all those years, alive, kicking and making releases. Business as usual.



Eclipse Releases Theia IDE
27/06/2024

The Eclipse Foundation has released Theia IDE, which they say is created for developers seeking a modern, open, and flexible tool for their coding pursuits. The IDE is based on the Theia Platform, whi [ ... ]


More News

Last Updated ( Sunday, 18 March 2012 )