Monthly Archives: December 2012
The code for our voice recognition example from the presentation
import voce.*;
import processing.video.*;
Movie theMov;
boolean isPlaying;
boolean isLooping;
void setup() {
size(540,400);
theMov = new Movie(this, “wizard animation.mov”);
theMov.loop();
isPlaying = true;
voce.SpeechInterface.init(sketchPath+”/code/”, true, true, sketchPath+”/data/”, “test”);
}
void draw() {
background(0);
image(theMov, 0,0);
while (voce.SpeechInterface.getRecognizerQueueSize() > 0){
String s = voce.SpeechInterface.popRecognizedString();
println(“You said: ” + s);
voce.SpeechInterface.synthesize(s);
if(s.equals(“pause”)){
theMov.stop();
isPlaying = false;
}
if(s.equals(“play”)) {
theMov.loop();
}
}
}
void movieEvent(Movie m) {
m.read();
}