Beispiel #1
0
 public static SdirPreset ReadSdirPreset(string filePath)
 {
     SdirPreset sdir = new SdirPreset();
     if (sdir.Read(filePath)) {
         return sdir;
     } else {
         return null;
     }
 }
Beispiel #2
0
        public static SdirPreset ReadSdirPreset(string filePath)
        {
            SdirPreset sdir = new SdirPreset();

            if (sdir.Read(filePath))
            {
                return(sdir);
            }
            else
            {
                return(null);
            }
        }
        private void SDIR2WavConvert(string inputFilePath, string outputFilePath = null)
        {
            string directoryName = Path.GetDirectoryName(inputFilePath);
            string fileName      = Path.GetFileNameWithoutExtension(inputFilePath);

            if (outputFilePath == null)
            {
                outputFilePath = directoryName + Path.DirectorySeparatorChar + fileName + ".wav";
            }

            SdirPreset sdir = SdirPreset.ReadSdirPreset(inputFilePath);

            if (sdir != null)
            {
                AudioUtilsNAudio.CreateWaveFile(sdir.WaveformData, outputFilePath, new NAudio.Wave.WaveFormat(sdir.SampleRate, sdir.BitsPerSample, sdir.Channels));
                textBox1.AppendText(String.Format("Converted {0}\n", inputFilePath));
            }
        }