Esempio n. 1
0
        private async Task <DialogTurnResult> PromptForNameStepAsync(
            WaterfallStepContext stepContext,
            CancellationToken cancellationToken)
        {
            var greetingState = await UserProfileAccessor.GetAsync(stepContext.Context);

            if (string.IsNullOrWhiteSpace(greetingState.Name))
            {
                await SpeechService.TextToSpeechAsync("Hi, What is your name?");

                // prompt for name, if missing
                var opts = new PromptOptions
                {
                    Prompt = new Activity
                    {
                        Type = ActivityTypes.Message,
                        Text = "What is your name?",
                    },
                };
                SpeechService.PlaySound();
                return(await stepContext.PromptAsync(NamePrompt, opts));
            }
            else
            {
                return(await stepContext.NextAsync());
            }
        }
 private async void ImageButton_Clicked(object sender, EventArgs e)
 {
     await _speechService.TextToSpeechAsync(_translateResultPageViewModel.InputText, _translateResultPageViewModel.InputLanguage);
 }