public async Task <IActionResult> Speak([FromServices] ITextSpeaker textSpeaker, string id) { //todo: id to text await textSpeaker.Speak(id); return(Json(MessageResult.SuccessResult("OK", id))); }
public async Task <IActionResult> GetSpeak([FromServices] ITextSpeaker textSpeaker, string id) { //todo: id to text await textSpeaker.Speak(id); ViewBag.MessageResult = id; return(View("Index")); }
public Task <MessageResult> Play(string soundId, bool playDefaultIfNotExist) { var playSoundFile = GetPlaySoundFile(soundId, playDefaultIfNotExist); _textSpeaker.Speak(playSoundFile.Description); var filePath = MapContentRootPath(playSoundFile.FilePath); return(PlayFile(filePath)); }