I want to use Google Speech API in my current project.
I got my information about how to access the api from here
As described on github, you have to send a post webrequest to the server and get back a result as json.
I also got some source code used for the v1 api from here
Setting up the request is not that hard:
WebRequest request = WebRequest.Create(Constants.GoogleRequestString);
request.Method = "POST";
request.ContentType = "audio/x-flac; rate=" + sampleRate;
request.ContentLength = bytes.Length;
Where in my example the Constants.GoogleRequestString equals to https://www.google.com/speech-api/v2/recognize?output=json&lang=en-us&key=AIzaSyCnl6MRydhw_5fLXIdASxkLJzcJh5iX0M4
I downloaded the .flac files from the github link and wrote a little program in c# which is loading the bytes of the flac file and sending it to the server with the slightly modified method GoogleRequest(byte[] bytes, int sampleRate)
I open the stream as shown in the method, and send all bytes to the server. I get the response but
The JSON String I get is: "{\"result\":[]}"
I have no idea why it is not working. Either the file, or spoken text in the file is not correct (but if I listen to it with vlc I clearly hear the spoken text) or my program still has some bugs.
Have you ever encountered the problem to get no result by the speech-api? Should't it say something like result: couldn't understand what is spoken or any other error message?
I just tried out the .wav file. This worked for me.

