All pastes #2046784 Raw Edit

SpeechGet- java src

public java v1 · immutable
#2046784 ·published 2011-04-15 12:16 UTC
rendered paste body
package SpeechGet;import edu.cmu.sphinx.frontend.util.*;import edu.cmu.sphinx.recognizer.Recognizer;import edu.cmu.sphinx.result.Result;import edu.cmu.sphinx.util.props.ConfigurationManager;public class SpeechGet {public static void main(String args[]){	ConfigurationManager cm;cm=new ConfigurationManager();Recognizer recognizer=(Recognizer) cm.lookup("recognizer");try{	recognizer.allocate();}catch(Exception e){	System.out.println("EXCEPTION!! RECOGNIZER");}Microphone microphone=(Microphone) cm.lookup("microphone");try{if(!microphone.startRecording()){	System.out.println("Cant record");	recognizer.deallocate();	System.exit(0);}}catch(Exception e){System.out.println("EXCEPTION!! MIC");}while(true){	System.out.println("start speaking");	try{	Result result=recognizer.recognize();	if(result!=null){		try{		String result_text=result.getBestPronunciationResult();		System.out.println("you said :"+result_text+"\n");		}		catch(Exception e){			System.out.println("Exception result etbestprononciatio");		}		}	else		System.out.println("you said nothinh \n");	}        /*always prints this error below*/	catch(Exception e){System.out.println("EXCEPTION!! Result"+e.getMessage());}}}}