Hi, I am using Speech-to- text and uploading one hindi language wave file but am not getting response in hindi language rather getting english language text. Below mentioned in my code.
var config = SpeechConfig.FromHost(new Uri("ws://**.io:5000/"));
var fileFullPath = await ReadFilePath(file);
var sourceLanguageConfig = SourceLanguageConfig.FromLanguage("hi-IN");
using (var audioConfig = AudioConfig.FromWavFileInput(fileFullPath))
using (var recognizer = new SpeechRecognizer(config, sourceLanguageConfig, audioConfig))
{
var result = await recognizer.RecognizeOnceAsync();
if (result.Reason == ResultReason.RecognizedSpeech)
{
Console.WriteLine($"We recognized: {result.Text}");
}
else if (result.Reason == ResultReason.NoMatch)
{
Console.WriteLine($"NOMATCH: Speech could not be recognized.");
}
else if (result.Reason == ResultReason.Canceled)
{
var cancellation = CancellationDetails.FromResult(result);
Console.WriteLine($"CANCELED: Reason={cancellation.Reason}");
if (cancellation.Reason == CancellationReason.Error)
{
Console.WriteLine($"CANCELED: ErrorCode={cancellation.ErrorCode}");
Console.WriteLine($"CANCELED: ErrorDetails={cancellation.ErrorDetails}");
Console.WriteLine($"CANCELED: Did you update the subscription info?");
}
}
var data = new Response()
{
Prediction = result.Text
};
return new JsonResult(data);
}