Beispiel #1
0
        /* Input: (int)start time, (int)final time, (string)input file, (string) output_file
         * Description: This is the test function for cutting the file
         * Output: True or False
         */
        static public bool test_cut(int start_time, int final_time, string input_file, string output_file)
        {
            AudioProcess process = new AudioProcess();

            output_file = input_file.Replace(".wav", "_cut.wav");
            process.cut_file(start_time, final_time, input_file, output_file);
            bool ret = true;

            try
            {
                FileStream file = File.Open(output_file, FileMode.Open);
                if (file.Length == 0)
                {
                    ret = false;
                }
                file.Close();
            }
            catch (IOException e)
            {
                ret = false;
            }
            return(ret);
        }
Beispiel #2
0
        /* Input: (double)pitch value, (string)input file, (string) output_file
         * Description: This is the test function for changing the temp of the file
         * Output: True or False
         */
        static public bool test_pitch(double pitch, string input_file, string output_file)
        {
            AudioProcess process = new AudioProcess();

            output_file = input_file.Replace(".wav", "_pitch.wav");
            process.adjust_pitch(pitch, input_file, output_file);
            bool retp = true;

            try
            {
                FileStream file = File.Open(output_file, FileMode.Open);
                if (file.Length == 0)
                {
                    retp = false;
                }
                file.Close();
            }
            catch (IOException e)
            {
                retp = false;
            }
            return(retp);
        }