public async Task <IActionResult> ParseSpeectToTextAWS([FromBody] ClientWavObject clientInput) { var sw = new Stopwatch(); sw.Start(); var input = new string[] { clientInput.Base64String }; var result = await _awsService.ParseSpeectToText(input); if (result == null) { return(BadRequest("An unknown error has occured")); } sw.Stop(); result.TotalBackendTimeInMilliseconds = sw.ElapsedMilliseconds; return(Ok(result)); }
public IActionResult ParseSpeectToTextAzure([FromBody] ClientWavObject clientInput) { var sw = new Stopwatch(); sw.Start(); //Language can be set in the url var input = new[] { "https://speech.platform.bing.com/speech/recognition/interactive/cognitiveservices/v1?language=en-GB&format=detailed", clientInput.Base64String }; var result = _bingSpeechService.ParseSpeectToText(input); if (result == null) { return(BadRequest("An unknown error has occured")); } sw.Stop(); result.TotalBackendTimeInMilliseconds = sw.ElapsedMilliseconds; return(Ok(result)); }