ttslib for processing

Nikolaus Gradwohl2009-05-16T20:31:00+02:00

i have written another library for processing. This time its a wrapper around the freetts library

now processing sketches can have a voice too.

click here to go to the project page.

i cannot present an applet as an example this time, because freetts doesn't work in applets. So i show the example.

import guru.ttslib.*;

TTS tts;

void setup() {
  size(100,100);
  smooth();
  tts = new TTS();
}

void draw() {
  background(255);
  fill(255);
  ellipse( 35, 30, 25, 35 );
  ellipse( 65, 30, 25, 35 );
  fill(0);
  ellipse( 40, 35, 10, 10 );
  ellipse( 60, 35, 10, 10 );
  noFill();
  arc(50,50,50,50,0,PI);

}

void mousePressed() {
  tts.speak("Hi! I am a speaking Processing sketch");
}
Tweet This! submit to reddit Digg!   Tags: | 3 comments | no trackbacks

Trackbacks

Comments

Leave a response

  1. nicole 2009-12-14T20:25:08+01:00

    How would you change voices with this library? Is it exposed anywhere?

  2. Nikolaus Gradwohl 2009-12-15T01:13:42+01:00

    you can use the TTS( "voicename" ) constructor to switch between the installed voiced by default kevin16 and alan get installed, mbrola voiced should work, but i haven't tried them yet

  3. sam 2011-11-30T17:55:22+01:00

    is there a way to run multiple "speeches" simultaneously? e.g. start speaking a second line before the first is finished?

    with this code...

    void mousePressed() { tts.speak("Hi! I am a speaking Processing sketch"); tts.speak("overlapping speech"); }

    ...it just reads one, then the other.

Leave a comment