public void OpenScenarioSetupForm(SpeakerRecognitionService speakerRecognitionService, SpeechConfig speechConfig)
        {
            this.hostGrid.Height = Window.Current.Bounds.Height;
            this.hostGrid.Width  = Window.Current.Bounds.Width;

            this.speakerRecognitionService = speakerRecognitionService;
            this.speechConfig = speechConfig;

            this.newModelForm.IsOpen = true;
        }
Exemplo n.º 2
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            this.isWestUSRegion = !string.IsNullOrEmpty(SettingsHelper.Instance.SpeechApiEndpoint) && SettingsHelper.Instance.SpeechApiEndpoint.Contains("westus.");
            if (!string.IsNullOrEmpty(SettingsHelper.Instance.SpeechApiKey) && isWestUSRegion)
            {
                this.mainPage.IsEnabled       = true;
                this.userProvidedSpeechConfig = SpeechConfig.FromSubscription(SettingsHelper.Instance.SpeechApiKey, DefaultSpeechAPIRegion);
                this.userProvidedSpeakerRecognitionService = new SpeakerRecognitionService(SettingsHelper.Instance.SpeechApiKey, $"https://{DefaultSpeechAPIRegion}.api.cognitive.microsoft.com");

                ProcessState = ProcessState.Overview;
                await LoadModelsAsync();
            }
            else
            {
                this.mainPage.IsEnabled = false;
                await new MessageDialog("Missing or unsupported Speech API Key in the Settings Page. \nSpeaker Recognition is a preview service, and currently only available in the West US region.", "Missing API Keys").ShowAsync();
            }

            base.OnNavigatedTo(e);
        }