Skip to content

Instantly share code, notes, and snippets.

@getflourish
Created June 9, 2011 16:57
Show Gist options
  • Save getflourish/1017178 to your computer and use it in GitHub Desktop.
Save getflourish/1017178 to your computer and use it in GitHub Desktop.
/*
// This is a basic example to demonstrate how the Speech-To-Text Library
// can be used. See www.getflourish.com/sst/ for more information on
// available settings.
//
// Florian Schulz 2011, www.getflourish.com
*/
import com.getflourish.stt.*;
STT stt;
String result;
void setup ()
{
size(600, 200);
noCursor();
// Init STT automatically starts listening, files are stored as history
stt = new STT(this);
stt.debug(true);
stt.setLanguage("en");
// Some text to display the result
textFont(createFont("Arial", 24));
result = "Say something!";
}
void draw ()
{
background(0);
text(result, mouseX, mouseY);
}
// Method is called if transcription was successfull
void transcribe (String utterance, float confidence)
{
result = utterance;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment