/* Sphinx wrapper for use in Processing. Works with Sphinx-4 1.0beta5 build from Hellow World example in Sphinx-4 Application Programmers Guide: http://cmusphinx.sourceforge.net/sphinx4/doc/ProgrammersGuide.html#helloworld with reference to Listen.java from Chatter project by Mie Sorensen et al.: http://www.lilwondermat.com/downloads/Chatter.zip rtwomey@u.washington.edu */ // processing stuff import processing.core.*; public class Scripter { PApplet parent; String template[] = { "" }; String in_f; public Scripter(PApplet _p, String _in_f) { this.parent = _p; this.in_f = _in_f; init(); } private void init() { System.out.println("Initializing Scripter:"); loadText(this.in_f); System.out.println(" input file " + in_f); } public void checkNext(String next) { print "implement check next"; } private void loadText(String filename) { //String lines[] = loadStrings("two stroke engine2.txt"); //String lines[] = loadStrings("script.txt"); //String lines[] = loadStrings("SCIP.txt"); lines = loadStrings(filename); if(lines != null) { println("there are " + lines.length + " lines:"); } else { println("error, no text in file "+filename+". exiting."); exit(); }; //for(int i=0;i