Features Podcasts Family Video Comics Music Tech Science Books Film & TV Games ✚

Jill

Speech synthesizer in 1K of Javascript

Cory Doctorow at 12:51 pm Thu, Mar 15, 2012

— FEATURED —

Book Review

Black Code: how spies, cops and crims are making cyberspace unfit for human habitation

Book Review

We Can Fix it! - a graphic novel time travel memoir

Science

The technology that links taxonomy and Star Trek

— FOLLOW US —

Boing Boing is on Twitter and Facebook. Subscribe to our RSS feed or daily email.

 

— POLICIES —

Except where indicated, Boing Boing is licensed under a Creative Commons License permitting non-commercial sharing with attribution

 

— FONTS —

Tweet
Kindle

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)

I write books. My latest is a YA science fiction novel called Homeland (it's the sequel to Little Brother). More books: Rapture of the Nerds (a novel, with Charlie Stross); With a Little Help (short stories); and The Great Big Beautiful Tomorrow (novella and nonfic). I speak all over the place and I tweet and tumble, too.

MORE:  floss • happy mutants • maker • web theory

More at Boing Boing

The technology that links taxonomy and Star Trek

Hackers prepare for first "national holiday" in their honor

  • http://profile.yahoo.com/GYHE6TEM5WTUC4ISJNCRVXP7ZE Jose

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

    • Nylund

      Yes, but it’s actually kinda fun to make ghetto beats with those sounds.

  • jtropp1

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

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

  • Gnatcatcher

    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

    • http://twitter.com/thaxter Jason Thaxter

       great idea. try this:
      uns uns uns uns uns unsuns uns uns uns unsuns uns uns uns uns unsuns uns uns uns uns uns uns

  • xzzy

    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)

  • technogeekagain

    Not sure whether it barely fails or barely succeeds.  Cute attempt anyway.

  • Adjam Oliver

    po1 is a fucking genius!

  • Terranex

    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.

  • Paul Renault

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

    • Jonathan Badger

      Well, without the Victorian woodcut next to the source code…

  • http://www.matthewpetty.com/ Matthew Petty

    I got it to say “I am the Gorfian Empire”

    • Jonathan Badger

      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.

      • Steve Taylor

        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…

        • Glen Able

          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.

      • Paul Renault

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

        https://www.youtube.com/watch?v=Bf7z8kjza2c

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

  • AirPillo

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

  • robbersdog

    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!

  • Kernit the Font

    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.

    • SamSam

      That one’s very nice, especially with a second “return” after about two seconds.

  • awjt

    lol

  • awjt

    I wrote a song.

    ioioioioioioiioioioioioioiooiooiooioiioioooioooioooiooiooooooiooioooioooiooooiooooiooiooiooioooiooioooioiiiiiiiiooioiooiiiiiiiiiiioiiiiiiiiioiiiiiioioioioioioiiiiiiiiiiiioiiiiiiiooioioioioioioioioeeeeeeeeeaaeaeaeaeaeeaeeeeeuuiouiooiuoiuoiuoiuoiuoiuaoeuaoeiuaeoiaueoiaeuaoieuaeoiaueoaieuaoieuaoieuaoieuaeoiuaeoiaueoiaueaoieuoaeaeeeaeaoiaueoaueaeaeaeaeaeaeaaaaaaaaaaaaauuuuuuuuuuuuueeeeoooooooioioioioioioiioioioioioioiooiooiooioiioioooioooioooiooiooooooiooioooioooiooooiooooiooiooiooioooiooioooioiiiiiiiiooioiooiiiiiiiiiiioiiiiiiiiioiiiiiioioioioioioiiiiiiiiiiiioiiiiiiiooioioioioioioioioeeeeeeeeeaaeaeaeaeaeeaeeeeeuuiouiooiuoiuoiuoiuoiuoiuaoeuaoeiuaeoiaueoiaeuaoieuaeoiaueoaieuaoieuaoieuaoieuaeoiuaeoiaueoiaueaoieuoaeaeeeaeaoiaueoaueaeaeaeaeaeaeaaaaaaaaaaaaauuuuuuuuuuuuueeeeoooooooioioioioioioiioioioioioioiooiooiooioiioioooioooioooiooiooooooiooioooioooiooooiooooiooiooiooioooiooioooioiiiiiiiiooioiooiiiiiiiiiiioiiiiiiiiioiiiiiioioioioioioiiiiiiiiiiiioiiiiiiiooioioioioioioioioeeeeeeeeeaaeaeaeaeaeeaeeeeeuuiouiooiuoiuoiuoiuoiuoiuaoeuaoeiuaeoiaueoiaeuaoieuaeoiaueoaieuaoieuaoieuaoieuaeoiuaeoiaueoiaueaoieuoaeaeeeaeaoiaueoaueaeaeaeaeaeaeaaaaaaaaaaaaauuuuuuuuuuuuueeeeoooooooioioioioioioiioioioioioioiooiooiooioiioioooioooioooiooiooooooiooioooioooiooooiooooiooiooiooioooiooioooioiiiiiiiiooioiooiiiiiiiiiiioiiiiiiiiioiiiiiioioioioioioiiiiiiiiiiiioiiiiiiiooioioioioioioioioeeeeeeeeeaaeaeaeaeaeeaeeeeeuuiouiooiuoiuoiuoiuoiuoiuaoeuaoeiuaeoiaueoiaeuaoieuaeoiaueoaieuaoieuaoieuaoieuaeoiuaeoiaueoiaueaoieuoaeaeeeaeaoiaueoaueaeaeaeaeaeaeaaaaaaaaaaaaauuuuuuuuuuuuueeeeooooooo

  • SamSam

    a b c d e f g h i j k l m n o p q r s t u v w x y z

    sounds pretty sweet

  • jjatria

    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

  • coop

    I bet Adobe could achieve the same effect with 1 GB of code.

    coop

  • Robert Holmen

    E I E I O

  • Mathieu Henri

    ^___^ 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.

    • xzzy

      Give it a “save to file” feature so we can export our beats into a track editor. :D

    • awjt

       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!!!

  • Mark Dow

    iem sari dav  i kant do dat

  • hadlockk

    Seems to have a thick Indian accent.

  • ppdd

    Decidedly less irritating than Siri.

  • Pietari Kokko

    domo arigaa.tomister robo to

  • Jason Aeschliman

    aeiouaeiouaeiou