0
votes

I am facing trouble when I use my code to interact with google speech api. I have gone through the reference from the following link. JAVA using google speech recognition API

when I am using his flac file I am getting the text from google api but when I am using my flac file I am getting the following error Done

Exception in thread "main" java.io.IOException: Error writing to server
    at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
    at test.TestGoogleApiForSpeechRecognition.main(TestGoogleApiForSpeechRecognition.java:42)

I have recorded from windows recoder and convert it to flac by using a converter. The coode is given below:

http://pastebin.com/jWnDRrrf

and the flac file is on the following link

http://www8.zippyshare.com/v/91948469/file.html

1

1 Answers

0
votes

Hmm, I suspect the issue lies in your request property. For instance, for my experimentation, it appears that Google whitelists certain user agents. I would just use this API to interface with Google.