Beispiel #1
0
        public static DataExtractor GetInstance()
        {
            if (instance == null)
            {
                instance = new DataExtractor();
            }

            return(instance);
        }
        private double CalculateTimeLength(string wavPath)
        {
            var resultPath = currentExercicePath + "TimeLength.txt";

            if (!File.Exists(resultPath))
            {
                File.Create(resultPath).Close();
            }
            else
            {
                File.WriteAllText(resultPath, string.Empty);
            }
            var scriptPath = this.scripting.WriteTimeLengthScript(wavPath, this.CurrentActivity.PitchMin, resultPath);

            this.connector.GetResult(scriptPath);

            return(DataExtractor.GetInstance().GetTimeLengthValue(resultPath));
        }
        private ICollection <DataLineItem> CalculateIntensityAndFrequency(string wavPath)
        {
            var resultPath = currentExercicePath + "IntensityFrequency.txt";

            if (!File.Exists(resultPath))
            {
                File.Create(resultPath).Close();
            }
            else
            {
                File.WriteAllText(resultPath, string.Empty);
            }
            var scriptPath = this.scripting.WriteIntensityFrequencyScript(wavPath, this.CurrentActivity.PitchMin, this.CurrentActivity.PitchMax, this.CurrentActivity.IntensityThreshold, resultPath);

            this.connector.GetResult(scriptPath);

            return(DataExtractor.GetInstance().GetIntensityFrequencyValues(resultPath));
        }