String jsonRequest = "{\"config\": {\"languageCode\":\"en-US\"},\"audio\": {\"content\": \"" + base64Content+ "\"}}";
String str = "";
var speech = SpeechClient.Create();
var response =
speech.Recognize(RecognizeRequest.Parser.ParseJson(jsonRequest));
foreach (var result in response.Results)
{
foreach (var alternative in result.Alternatives)
{
Console.WriteLine(alternative.Transcript);
str += alternative.Transcript;
}
}
This code is working fine with mono .wav files but it throws exception for stereo files. The exception says
Status(StatusCode=InvalidArgument, Detail="Must use single channel (mono) audio, but WAV header indicates 2 channels.")
So, my question is how can I add support for stereo files? How to convert multi channel audio to a single channel in c#? I have already tried this answer so plz don't refer to it. It is not working.