Beispiel #1
0
 public void changeSoundFile()
 {
     try
     {
         Console.WriteLine("soundfile changed");
         string origsndcapfile = Environment.CurrentDirectory + Path.DirectorySeparatorChar + "sndcap" + Path.DirectorySeparatorChar + sndcapnum.ToString() + ".wav";
         IntPtr soundfold      = soundf;
         string sndcapfile     = nextSoundFile();
         soundf = LibsndfileWrapper.sf_open(sndcapfile, (int)LibsndfileWrapper.fileMode.SFM_WRITE, ref soundfInfo);
         LibsndfileWrapper.sf_close(soundfold);
         callpraat(origsndcapfile);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Beispiel #2
0
 public WaveWriter()
 {
     try
     {
         if (!Directory.Exists(Environment.CurrentDirectory + Path.DirectorySeparatorChar + "sndcap"))
         {
             Directory.CreateDirectory(Environment.CurrentDirectory + Path.DirectorySeparatorChar + "sndcap");
         }
         soundfInfo.channels   = NUM_CHANNELS;
         soundfInfo.samplerate = SAMPLE_RATE;
         soundfInfo.format     = ((int)LibsndfileWrapper.soundFormat.SF_FORMAT_WAV | (int)LibsndfileWrapper.soundFormat.SF_FORMAT_FLOAT);
         string sndcapfile = nextSoundFile();
         soundf         = LibsndfileWrapper.sf_open(sndcapfile, (int)LibsndfileWrapper.fileMode.SFM_WRITE, ref soundfInfo);
         pauseCountup   = PAUSECOUNTUP;
         pauseCountdown = PAUSECOUNTDOWN;
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }