Hey guys,
I'm trying to write the program with speech recognition that can run on the website.
I am struggling with rewritting this code into Java Script, i am quite a novice at Java Scripting but would like to use this code in a website for speech to text. Unfortunatly I can not use this, as STT doesn't work as an applet, Uccording to my reseach I can have this code working using Java script. Please can someone help me or maybe someone can suggest any other options.
import com.getflourish.stt.*;
import java.awt.*;
STT stt;
String result;
PFont font;
void setup ()
{
size(600, 200);
frameRate(1);
// Init STT with default manual record mode
stt = new STT(this);
stt.enableDebug();
stt.setLanguage("en");
// Some text to display the result
textFont(createFont("Arial", 24));
result = "Say something!";
}
void draw ()
{
background(0);
text(result, mouseX, mouseY);
int len = result.length();
}
// Method is called if transcription was successfull
void transcribe (String word, float confidence)
{
// println(utterance);
result = word;
}
// Use any key to begin and end a record
public void keyPressed () {
stt.begin();
}
public void keyReleased () {
stt.end();
}
Thanks
I'm trying to write the program with speech recognition that can run on the website.
I am struggling with rewritting this code into Java Script, i am quite a novice at Java Scripting but would like to use this code in a website for speech to text. Unfortunatly I can not use this, as STT doesn't work as an applet, Uccording to my reseach I can have this code working using Java script. Please can someone help me or maybe someone can suggest any other options.
import com.getflourish.stt.*;
import java.awt.*;
STT stt;
String result;
PFont font;
void setup ()
{
size(600, 200);
frameRate(1);
// Init STT with default manual record mode
stt = new STT(this);
stt.enableDebug();
stt.setLanguage("en");
// Some text to display the result
textFont(createFont("Arial", 24));
result = "Say something!";
}
void draw ()
{
background(0);
text(result, mouseX, mouseY);
int len = result.length();
}
// Method is called if transcription was successfull
void transcribe (String word, float confidence)
{
// println(utterance);
result = word;
}
// Use any key to begin and end a record
public void keyPressed () {
stt.begin();
}
public void keyReleased () {
stt.end();
}
Thanks
1