Pregunta

I am trying to convert Speech to Text and im having no luck, I imported the JSAPI jar into my project but when I run my Script I get:

ava.lang.NullPointerException at CLAIRE.main(CLAIRE.java:13)

How do I change the variable from null and fix it?

public static void main(String[] args) {

    try {
        Recognizer rec = Central.createRecognizer(new EngineModeDesc(
                Locale.US));

        rec.allocate();

    } catch (Exception e) {
        e.printStackTrace();
    }
}
¿Fue útil?

Solución

The JSAPI implementation you're using does not support an US recognizer. Check out createRecognizer javadoc:

Returns:
       a recognizer matching the required properties or null if none is available

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top