lkuza2 / java-speech-api

The J.A.R.V.I.S. Speech API is designed to be simple and efficient, using the speech engines created by Google to provide functionality for parts of the API. Essentially, it is an API written in Java, including a recognizer, synthesizer, and a microphone capture utility. The project uses Google services for the synthesizer and recognizer. While this requires an Internet connection, it provides a complete, modern, and fully functional speech API in Java.
GNU General Public License v3.0
535 stars 301 forks source link

Add authentication failure callback #61

Open Jerry0022 opened 9 years ago

Jerry0022 commented 9 years ago

Thanks for your great API. It works perfectly! But! If I set a wrong API key or no API key there is an exception thrown in the http thread... Exception in thread "Downstream Thread" java.lang.NullPointerException com.darkprograms.speech.recognizer.GSpeechDuplex$1.run(GSpeechDuplex.java:197)

Can you enable a possibility to catch it via callback for example?

Skylion007 commented 9 years ago

Hmm, I see. I really do need to fix that. When I wrote that class, I knew next to nothing about multithreading. That is definitely on my long list of things to do.

There is even an if statement that I added awaiting an implementation of that feature. If you are willing to add the callback, I will gladly merge it in.

Jerry0022 commented 9 years ago

Please see pull request ;)

Skylion007 commented 9 years ago

@Jerry0022 Protip; In the future please reference the issue number instead as it will provide an hyperlink to the pull request like so: #64