Hello everyone,
I try to use the speech to text library but my program said " The constructor STT(voiceRecognition) is undefined ". I can't understand why... Can you help me please ? The problem is with the line " stt = new STT(this); "
Here is my code :
import com.getflourish.stt.*;
import ddf.minim.*;
import javax.sound.sampled.*;
STT stt;
String result;
void setup ()
{
size(300,300);
//---------------Init STT automatically starts listening------------//
//intialisation of the stt
stt = new STT(this);
//enables console output with relevant information about the transcription process
stt.enableDebug();
//choose the language of the recorder
stt.setLanguage("fr");
//analyzed the environment sound level and automatically records if anything louder than the average level is recognized
stt.enableAutoRecord();
//just write something in the window
textFont(createFont("Arial", 24));
result="Say something please";
}
void draw ()
{
background(0);
//normaly it will display what you said in the window
text(result, 50, 50);
/* Does this method work ?
if(result.equals("Right"))
{
println("ok");
result="y";
}*/
}
//
void transcribe (String utterance, float confidence)
{
println(utterance);
result = utterance;
}
//if you want to want to have event to manage the voice recognition you can use those methods and delete the enableAutoRecord()
public void keyPressed()
{
if(key == ' ') stt.begin();
}
public void keyReleased()
{
if(key == ' ') stt.end();
}