This is the code i am using speech to text i have installed micro-soft speech engine when i run this code it show null pointer exception in rec.allocate(); line
import javax.speech.*;
import javax.speech.recognition.*;
import java.io.FileReader;
import java.util.*;
public class HelloWorld extends ResultAdapter {
public static void main(
String args[]) {
try {
// Create a recognizer that supports English.
rec = Central.createRecognizer(new EngineModeDesc(Locale.ENGLISH));
// Start up the recognizer
rec.allocate();
} catch (Exception e) {
e.printStackTrace();
}
}
}