/// <summary> /// Initialization constructor for the verify speaker page /// </summary> public VerifySpeakerPage() { InitializeComponent(); _subscriptionKey = ((MainWindow)Application.Current.MainWindow).SubscriptionKey; IsolatedStorageHelper _storageHelper = IsolatedStorageHelper.getInstance(); string _savedSpeakerId = _storageHelper.readValue(MainWindow.SPEAKER_FILENAME); if (_savedSpeakerId != null) { _speakerId = new Guid(_savedSpeakerId); } if (_speakerId == Guid.Empty) { ((MainWindow)Application.Current.MainWindow).Log("You need to create a profile and complete enrollments first before verification"); recordBtn.IsEnabled = false; stopRecordBtn.IsEnabled = false; } else { initializeRecorder(); _serviceClient = new SpeakerVerificationServiceClient(_subscriptionKey); string userPhrase = _storageHelper.readValue(MainWindow.SPEAKER_PHRASE_FILENAME); userPhraseTxt.Text = userPhrase; stopRecordBtn.IsEnabled = false; } }
/// <summary> /// Creates a new EnrollPage /// </summary> /// <param name="subscriptionKey">The subscription key</param> public EnrollPage() { InitializeComponent(); _subscriptionKey = ((MainWindow)Application.Current.MainWindow).SubscriptionKey; _serviceClient = new SpeakerVerificationServiceClient(_subscriptionKey); initializeRecorder(); initializeSpeaker(); }