Пример #1
0
        public async Task <IActionResult> Speak([FromServices] ITextSpeaker textSpeaker, string id)
        {
            //todo: id to text
            await textSpeaker.Speak(id);

            return(Json(MessageResult.SuccessResult("OK", id)));
        }
Пример #2
0
        public async Task <IActionResult> GetSpeak([FromServices] ITextSpeaker textSpeaker, string id)
        {
            //todo: id to text
            await textSpeaker.Speak(id);

            ViewBag.MessageResult = id;
            return(View("Index"));
        }
Пример #3
0
        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));
        }