/// <summary>
 /// Creates a new EnrollPage
 /// </summary>
 /// <param name="subscriptionKey">The subscription key</param>
 public EnrollPage()
 {
     InitializeComponent();
     _subscriptionKey = ((MainWindow)Application.Current.MainWindow).SubscriptionKey;
     _serviceClient   = new SpeechVerificationServiceClient(_subscriptionKey);
     initializeRecorder();
     initializeSpeaker();
 }
        /// <summary>
        /// Initialization constructor for the verify speaker page
        /// </summary>
        public VerifySpeakerPage()
        {
            InitializeComponent();
            _subscriptionKey = ((MainWindow)Application.Current.MainWindow).SubscriptionKey;
            IsolatedStorageHelper _storageHelper = IsolatedStorageHelper.getInstance();

            _speakerId = _storageHelper.readValue(MainWindow.SPEAKER_FILENAME);
            if (_speakerId == null)
            {
                ((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 SpeechVerificationServiceClient(_subscriptionKey);
                string userPhrase = _storageHelper.readValue(MainWindow.SPEAKER_PHRASE_FILENAME);
                userPhraseTxt.Text      = userPhrase;
                stopRecordBtn.IsEnabled = false;
            }
        }