Speech synthesizer in 1K of Javascript

Mathieu 'P01' Henri, a French Web developer, has produced a functional speech synthesizer in 1k of JavaScript. It's an entry in the fourth JS1K competition.

JS1K#4 was colliding with our long awaited family vacation. I had very little time to work. Audio was ON this time and I had this tiny speech synthesizer laying around waiting to be ported to JavaScript and optimized to oblivion.

* Based on Tiny Speech Synth by Stepanov Andrey
* Optimized and minified manually, by yours truly
* Compressed down to 1020 bytes using First Crush by @tpdown

To go under 1K, I had to limit the synthesizer to two formant filters using either a sawtooth or noise and discard plosive sounds. In other words I had to sacrifice quality a bit.

Hope you like this entry.

JSK1K Speech Synthesizer

(via Waxy)


  1. I would be nice if it worked. All it does on my computer is output random broken sounds ” ah uhm eh ah um otlotl”…

  2. It didn’t handle this nearly as well as I’d hoped:

    “Work It Make It Do It Makes Us Harder Better Faster Stronger”

  3. Great beat box synthesizer:

    puh puh puh ts ts ts puh puh puh ts ts ts puh puh puh ts ts ts puh puh puh ts ts ts

  4. You can sort of figure out what it’s saying if you already know what it’s going to say (upon launch, it begins spouting out the line of text. Click on it with the mouse and you get a type cursor, allowing you to delete everything and start over).

    In any other cases it fails miserably however.

    That said, doing it at all in under 1K is pretty impressive. 

    (and it is really good at doing drum beats)

  5. oo oo oo ot oo ot oo ot oo os oo ot oo os oo ot oo os ooost ooost ooost

    There is potential in this.

  6. Wow, it’s the Beagle Brothers 256-byte Apple Basic program contests, for the 21st Century!

    1. Yep. People are so spoiled now. They actually want synthesized speech that actually sounds comprehensible. In the 1980s we were just happy that an arcade game *tried* to speak.

      1. On one karate game we released for the Sinclair Spectrum (‘Way of the Exploding Fist’) there was no spare memory for sound effects, so we experimented with playing different sections of the machine’s ROM through the speaker, looking for stuff that sounded vaguely Bruce Lee-ish.

        But kids these days…

        1. The speccy also had the “Currah microspeech” hardware add-on for speech synthesis.  However, that used a full 2K of ROM, so this new technology is showing good progress.

      2. Ah, yes, good ‘ole Castle Wolfenstein on an Apple ][.

        /It’s really important that you watch it in 720p, so that you get all the audio quality.

  7. I was surprised to be able to get a decent rythm going by just repeating “nyan gao gao gao”

  8. m s m s m s m ssm s m s m s m ssm ssm ssm ssm ssm m m m m m m m a i a i a i a aia aim aia aim ai ai o i a i o i aoaoaoaoaoaoaoaoa e m s m e m s m e m e m e m s m e ee m e ee s m e ee m ee m

    This is far too much fun!

  9. Lol, great minds think alike. Here’s a bit of acid: (P.S. If you hit return twice, you get a cool delay effect)

    tikitikitikitikitikitikitikitiki.Bm. tsh… bm s. Bm. tsh… bm s. Bm. tsh… bm s. Bm. tsh… bm s. Bm. tikka tikka Bm. tikka tikka Bm. tikka tikka Bm. tikka tikka Bm. tikka rikee Bm. tikka rikee Bm. tikka rikee Bm. tikka rikee. oooowow dada h. oooowow dada h. oooowow dada h. oooowow dada h. dooweedoowee o. dooweedoowee a. dooweedoowee e. dooweedoowee u. dooweedoowee o. dooweedoowee a. dooweedoowee e. dooweedoowee u.

  10. I wrote a song.


  11. Hah. Some of these are a lot of fun.

    uhkgas  u   es  uhkgas  u   es  uhkgas  u   es  uhkgas  u sses  uhkgas  u sses  uhkgass u sses  uhkgass aasses  uhkgass aisses  uhkgass aasses  uhkgass aisses puhkgassiiasses puhkgassiiasses p hkg ss   ss s p hkg ss   ss s 

    Or this one

    sss gssss gssss gss ss sss gssss gssss gssss gss ss sss gssss gssss gssss gss ss sss gssss

  12. ^___^ I didn’t expect people to have fun with my entry for JS1k, let alone write beats with it. Well done guys!

    PS: I know the quality of the speech is meh but Hey! It’s 1k of JS. I’ll try to optimize this puppy a little and see if I can squeeze a 3rd formant filter to the mix.

    1.  Do you have a tutorial or a link somewhere to formant filters?  I would like to learn some of this programming.  I followed the link to the original tiny synth, but that site is like written in Klingon.  I’m looking for something that a mere human can understand, if you have any refs.  THANKS!!!  And nice work!!!

Comments are closed.