Example #1
0
        public PreparationExecuter(ExerciceVM currentActivity)
        {
            this.Player              = new WAVPlayerRecorder();
            this.CurrentActivity     = currentActivity;
            this.scripting           = new PraatScripting(currentActivity.Name);
            this.connector           = PraatConnector.GetConnector();
            this.currentExercicePath = CurrentActivity.Example_wav_path;
            this.exerciceFolderPath  = Environment.GetEnvironmentVariable("LocalAppData") + "\\MyOrtho\\" + this.CurrentActivity.Name + "\\";
            if (!Directory.Exists(this.exerciceFolderPath))
            {
                Directory.CreateDirectory(this.exerciceFolderPath);
            }

            /*File.Copy(CurrentActivity.Example_wav_path, exerciceFolderPath + CurrentActivity.Name, true);
             * string currentExerciceFilePath = (this.exerciceFolderPath + "exercice" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt");
             *
             * Task.Run(() => this.CurrentActivity.Exercice = CalculateIntensityAndFrequency(this.CurrentActivity.Example_wav_path, currentExerciceFilePath));*/
        }
Example #2
0
        public CreationExecuter(ExerciceVM currentActivity)
        {
            this.Player          = new WAVPlayerRecorder();
            this.CurrentActivity = currentActivity;
            this.scripting       = new PraatScripting(currentActivity.Name);
            this.connector       = PraatConnector.GetConnector();

            TempExWavPath = CurrentActivity.Example_wav_path;

            this.tempRecordingsLocation = TEMP_PATH;
            if (!Directory.Exists(TEMP_PATH))
            {
                Directory.CreateDirectory(TEMP_PATH);
            }

            string currentExerciceFilePath = (TEMP_PATH + "TempPraatResults_" + currentActivity.Date + ".txt");
            string praatScriptTargetPath   = (TEMP_PATH + "TempScript_" + currentActivity.Date + ".praat");

            //string currentExerciceFilePath2 = (this.tempRecordingsLocation + "_" + CurrentActivity.Date + ".txt");

            Task.Run(() => this.CurrentActivity.Exercice = CalculateIntensityAndFrequency(this.CurrentActivity.Example_wav_path, currentExerciceFilePath, praatScriptTargetPath));
        }