Processing refuse to print out what i'm saying.
in
Contributed Library Questions
•
7 months ago
Hello ,
I'm using voce , a voice recognizer.
Everything work well , when i say fish , it show fish when i say cat it show cat, the only thing i want to do is that when i say fish , first of all : he show "fish" then he save it under fish.png and then it print it out !
but it don't seems to work, it's not really saying anything as a error but just not printing it out.
Can someone tell me what mistake i've made?
I'm using voce , a voice recognizer.
Everything work well , when i say fish , it show fish when i say cat it show cat, the only thing i want to do is that when i say fish , first of all : he show "fish" then he save it under fish.png and then it print it out !
but it don't seems to work, it's not really saying anything as a error but just not printing it out.
Can someone tell me what mistake i've made?
- import voce.*;
String s;
int xPos = 0;
int yPos = 0;
void setup() {
size(480, 200);
background(255);
voce.SpeechInterface.init("voce/library", true, true,
"voce/library/gram", "cat");
System.out.println("This is an awesome test");
textFont(createFont("NeutraTextTF-BookItalicAlt", 24));
}
void draw() {
stroke(255);
while (voce.SpeechInterface.getRecognizerQueueSize () > 0)
{
s = voce.SpeechInterface.popRecognizedString();
println(s);
voce.SpeechInterface.synthesize(s);
if (s.equals("cat")) {
save("cat.png");
}
if (s.equals("dog")) {
save("dog.png");
}
if (s.equals("fish")) {
save("fish.png");
String[] params = {
"lp", "/Users/Nathalie/Documents/Processing/fish.png"
};
exec(params);
println(params);
}
//textMode(SHAPE);
background(255);
fill(0);
text(s, 50, 50);
}
}
1