Пример #1
0
        private void CallCompareAudio(String recordWAV_file, String refWAV_file)
        {
            float compute_Result = compareAudio(recordWAV_file, refWAV_file);

            if (compute_Result > 0)
            {
                MessageBox.Show("Matched: " + compute_Result.ToString() + "\n You Win !");
                //If user wins, update level and display choice
                MessageBoxResult diagRes = MessageBox.Show("Do you want to proceed?\nYes to Proceed\nNo to Try Again", "important", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (diagRes == MessageBoxResult.Yes)
                {
                    read.Hide();

                    //If colorblind, change theme and go to new level
                    if (isColorBlind == true)
                    {
                        read.updateLevelProgress();
                        read.newLevel(isColorBlind);
                        read.saveLevelProgress(lvlStr);
                    }
                    //otherwise, revert old theme and go to new level
                    else
                    {
                        read.updateLevelProgress();
                        read.newLevel(isColorBlind);
                        read.saveLevelProgress(lvlStr);
                    }
                }
                //Otherwise, you can try again!!
                else if (diagRes == MessageBoxResult.No)
                {
                    read.Hide();
                    if (isColorBlind == true)
                    {
                        read.repeatLevel(isColorBlind);
                    }
                    else
                    {
                        read.repeatLevel(isColorBlind);
                    }
                }
            }
            else
            {
                MessageBox.Show("Matched: " + compute_Result.ToString() + "\n Try Again !");
            }
        }