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
531 stars 304 forks source link

java.io.IOException: Server returned HTTP response code: 400 for URL #93

Closed Usercreatedname closed 7 years ago

Usercreatedname commented 7 years ago

I get this error every time I try to run the code I have downloaded the newest version 2.02

type: WAVE type: AU type: AIFF type: FLAC Recording... Recording stopped. Sample rate is: 8000 ERROR: Google cannot be contacted java.io.IOException: Server returned HTTP response code: 400 for URL: http://www.google.com/speech-api/v2/recognize?client=chromium&output=json&lang=en-US&maxresults=4 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at com.darkprograms.speech.recognizer.Recognizer.rawRequest(Recognizer.java:455) at com.darkprograms.speech.recognizer.Recognizer.getRecognizedDataForFlac(Recognizer.java:280) at Swifty.main(Swifty.java:69)

I'm pretty new to this so any in-depth help would be appreciated

nirodg commented 7 years ago

I'm pretty sure they changed the way to interact with their API, have a look to this link https://cloud.google.com/speech/

goxr3plus commented 7 years ago

@Usercreatedname

To get access to the Google API, you need an API key. To get this, you need to follow the instructions here:

https://stackoverflow.com/questions/26485531/google-speech-api-v2

A sample application using this library can be found here:

See API-Example repository branch.

Have you done it ? :)

Usercreatedname commented 7 years ago

@goxr3plus Yeah I have an api key. I got it through the google developer console. I didn't understand the chromium instructions to get the api key though :/

tpawar1 commented 5 years ago

I am using text to speech api key for speech api ; is it work?

I am getting below error java.io.IOException: Server returned HTTP response code: 403 for URL: http: //www.google.com/speech-api/v2/recognize?client=chromium&output=json&lang=en-US&key=AIzaSyBnn5aFN9huzt5RMrQtTmWtTPRp0UTA9q4&maxresults=1

please help to resolve this issue.

goxr3plus commented 5 years ago

I will check this tommorow on my computer.Please remind me again :)!!!

On Fri, Nov 16, 2018, 09:24 tpawar1 notifications@github.com wrote:

I am using text to speech api key for speech api ; is it work?

I am getting below error java.io.IOException: Server returned HTTP response code: 403 for URL: http: // www.google.com/speech-api/v2/recognize?client=chromium&output=json&lang=en-US&key=AIzaSyBnn5aFN9huzt5RMrQtTmWtTPRp0UTA9q4&maxresults=1

please help to resolve this issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lkuza2/java-speech-api/issues/93#issuecomment-439305024, or mute the thread https://github.com/notifications/unsubscribe-auth/ATbiwHXcaGmV2LWj04xkZQbPaZZtOvqxks5uvmgogaJpZM4MCk1T .

tpawar1 commented 5 years ago

I will check this tommorow on my computer.Please remind me again :)!!! On Fri, Nov 16, 2018, 09:24 tpawar1 @.***> wrote: I am using text to speech api key for speech api ; is it work? I am getting below error java.io.IOException: Server returned HTTP response code: 403 for URL: http: // www.google.com/speech-api/v2/recognize?client=chromium&output=json&lang=en-US&key=AIzaSyBnn5aFN9huzt5RMrQtTmWtTPRp0UTA9q4&maxresults=1 please help to resolve this issue. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#93 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/ATbiwHXcaGmV2LWj04xkZQbPaZZtOvqxks5uvmgogaJpZM4MCk1T .

Hi Please check the issue.

MicrophoneAnalyzer mic = new MicrophoneAnalyzer(AudioFileFormat.Type.WAVE); GSpeechDuplex dup = new GSpeechDuplex("AIzaSyBnn5aFN9huzt5RMrQtTmWtTPRp0UTA9q4");

goxr3plus commented 5 years ago

Yes it seems the key is invalid, create a new private key.... ps check the new updated repository i have here with tutorials https://github.com/goxr3plus/java-google-speech-api

On Mon, Nov 19, 2018, 07:15 tpawar1 notifications@github.com wrote:

I will check this tommorow on my computer.Please remind me again :)!!! … <#m9199172475819844362> On Fri, Nov 16, 2018, 09:24 tpawar1 @.***> wrote: I am using text to speech api key for speech api ; is it work? I am getting below error java.io.IOException: Server returned HTTP response code: 403 for URL: http: // www.google.com/speech-api/v2/recognize?client=chromium&output=json&lang=en-US&key=AIzaSyBnn5aFN9huzt5RMrQtTmWtTPRp0UTA9q4&maxresults=1 please help to resolve this issue. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#93 (comment) https://github.com/lkuza2/java-speech-api/issues/93#issuecomment-439305024>, or mute the thread https://github.com/notifications/unsubscribe-auth/ATbiwHXcaGmV2LWj04xkZQbPaZZtOvqxks5uvmgogaJpZM4MCk1T .

Hi Please check the issue.

MicrophoneAnalyzer mic = new MicrophoneAnalyzer(AudioFileFormat.Type.WAVE); GSpeechDuplex dup = new GSpeechDuplex("AIzaSyBnn5aFN9huzt5RMrQtTmWtTPRp0UTA9q4");

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lkuza2/java-speech-api/issues/93#issuecomment-439774024, or mute the thread https://github.com/notifications/unsubscribe-auth/ATbiwI-mUO4AsmpMEmqg1ll1tvImC0D8ks5uwj5qgaJpZM4MCk1T .

lalithanjali0111 commented 5 years ago

Through curl command,I am able to send fax but through http request,I am getting Server returned HTTP response code: 400 for URL: https://my.dev.ringrx.com/voicemails/fax. Please Help to resolve this issue.